Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore hidden dirs, and non .m/texinfo files #116

Merged
merged 15 commits into from
Dec 17, 2015
Merged

Ignore hidden dirs, and non .m/texinfo files #116

merged 15 commits into from
Dec 17, 2015

Conversation

cbm755
Copy link
Collaborator

@cbm755 cbm755 commented Oct 31, 2015

Some fixes for various bugs. I did not add config flags: I figure we can add later if there is a use case...

Most importantly it stays out of one's .git

Explicitly list the sort of "format" we can deal with instead
of just assuming all non-texinfo are plain text.  This is a bit
more future proof too.

Looks like there is an Octave bug where "get_help_text ('blah.m')"
can return "Not found" instead of "Not documented", work around.
Its fine in Matlab but a single entry of a string can be multiple
bytes of utf-8 in Octave.
@cbm755
Copy link
Collaborator Author

cbm755 commented Oct 31, 2015

I'll merge this in 24 hours or so (if not objections). I'd like to release a 0.4.1 soon...

@cbm755
Copy link
Collaborator Author

cbm755 commented Oct 31, 2015

One possible concern, maybe its overly verbose?

>> doctest . -recursive
Doctest v0.4.1-dev: this is Free Software without warranty, see source.

Ignoring hidden directory ".git"
Descending into directory "0.4.0"
Descending into directory "inst"
doctest.m .............................................. PASS   10/10  
Ignoring directory "private"
Descending into directory "src"
Descending into directory "test"
Ignoring hidden directory ".hidden"
test_class ............................................. PASS    1/1   
@test_class/test_class ................................. PASS    1/1   

BTW, if you explicitly try to test a non m-file, you'll still get an (improved) error message:

>> doctest NEWS
Doctest v0.4.1-dev: this is Free Software without warranty, see source.

NEWS ................................................... EXTRACTION ERROR

    Not an m file.

(this is intended: it would be annoying to silently ignore it!)

continue
elseif (strcmp(f(1), '@'))
% strip @ to prevent processing as a directory
f = f(2:end);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have any implications for when there exist both a @foo and a foo directory?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might! I've not changed that behaviour with this commit though. Filed #120.

"single char" might be unicode (utf-8) on Octave.
Allow existence of both `foo` and `@foo`.  Fixes #120.
So both `doctest @foo` and `doctest foo` will work.

Strip `@` locally in the collect_targets_class() function, where
it causes problems, instead of trying to do this elsewhere.

When nonrecursive, stay out of `foo` when `@foo` happens to exist.

Add a `test/test_shadow/`.
@cbm755
Copy link
Collaborator Author

cbm755 commented Nov 4, 2015

Ok, I think this is ready, although I have not yet tested on Matlab.

@cbm755
Copy link
Collaborator Author

cbm755 commented Nov 4, 2015

actually, I can test on Matlab, and there seem to be some problems with classes so I will investigate. Not merge-able yet :(

I broke this previously, by not stripping "@" during the traversal.
In the new approach, we leave the problem of stripping "@" to the
"collect_targets_..." functions.  So add special treatment to the
top of "doctest_collect" were we classify the argument.
Also, "doctest class/method".

Fixes #124.
I wanted the ctor to have 2 tests and the method to have 1 so
I could tell which is was doing during debugging.
@cbm755
Copy link
Collaborator Author

cbm755 commented Nov 4, 2015

Ok works for me now on Matlab. Also fixed another pre-existing bug on Matlab.

Finish a sentence I left hanging (oops) and add a link to the Octave
bug about using "test" on private dirs.
@cbm755
Copy link
Collaborator Author

cbm755 commented Nov 7, 2015

Ok to commit this?

Despite the comments in our code, this seems to work fine.

Fixes #121
@cbm755 cbm755 changed the title Ignore hidden/private dirs, and non .m/texinfo files Ignore hidden dirs, and non .m/texinfo files Nov 11, 2015
@cbm755
Copy link
Collaborator Author

cbm755 commented Dec 17, 2015

Sorry dropped the ball a bit---I've finally responded to @catch22's query about #88.

May I merge this?

@catch22
Copy link
Collaborator

catch22 commented Dec 17, 2015

Sure!

cbm755 added a commit that referenced this pull request Dec 17, 2015
Ignore hidden dirs, and non .m/texinfo files
@cbm755 cbm755 merged commit a82f12d into master Dec 17, 2015
@cbm755 cbm755 deleted the ignore_some branch December 17, 2015 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants