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

Document that wildcard matching excludes some directories #14

Merged
merged 1 commit into from
Sep 24, 2016

Conversation

bradleyfalzon
Copy link
Contributor

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.

@bradleyfalzon bradleyfalzon changed the title Document that wildcards excludes some directories Document that wildcard matching excludes some directories Sep 6, 2016
@@ -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
Copy link
Contributor

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?

Copy link
Contributor Author

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".

Copy link
Contributor Author

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.

@dmitshur
Copy link
Contributor

dmitshur commented Sep 7, 2016

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.

For posterity, this is indeed expected, and it's documented in cmd/go:

image

But it should be nice to document it as part of gotool API as well, I think.

@dmitshur
Copy link
Contributor

dmitshur commented Sep 7, 2016

This wording LGTM, thanks for updating @bradleyfalzon.

@dmitshur
Copy link
Contributor

Friendly ping @kisielk or @dominikh, can you review and merge this?

@kisielk kisielk merged commit 5e136de into kisielk:master Sep 24, 2016
@kisielk
Copy link
Owner

kisielk commented Sep 24, 2016

Thanks for the ping, I was on vacation when this was filed / discussed :)

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.

3 participants