-
Notifications
You must be signed in to change notification settings - Fork 13
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
Document that wildcard matching excludes some directories #14
Conversation
300c442
to
62bcc99
Compare
@@ -24,6 +24,9 @@ type Context struct { | |||
// The path "std" is expanded to all packages in the Go standard library. | |||
// The path "cmd" is expanded to all Go standard commands. | |||
// The string "..." is treated as a wildcard within a path. | |||
// When matching using wilcards, directories with the prefix of dot or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One correction. This doesn't affect only wildcard (typo in that word), but also others. E.g., it affects "all".
Maybe just drop the "using wildcards" part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed on all accounts, but if we drop the wording of wildcards, would someone think a path of ./testdata
would be excluded (it wouldn't be)?
Perhaps "when recursively matching" or "when matching multiple packages"?
// When matching recursively, directories are ignored if they are prefixed with a
// dot or an underscore (such as ".foo" or "_foo"), or are named "testdata".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the push to reflect this, but still happy to make further changes.
62bcc99
to
3a3ca61
Compare
For posterity, this is indeed expected, and it's documented in But it should be nice to document it as part of |
This wording LGTM, thanks for updating @bradleyfalzon. |
Thanks for the ping, I was on vacation when this was filed / discussed :) |
I noticed one of my directories was being excluded when I didn't expect it to. The tool excludes testdata, as well as directories beginning with dot or underscore when recursively matching.
This is expected behaviour, but it wasn't documented publicly, this change adds those docs according to the behaviour in https://github.com/kisielk/gotool/blob/master/match.go#L91-L95.
I'm not convinced on the wording, so happy for this to be closed for another approach.
Thanks for the tool.