-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add exclude option #21
base: master
Are you sure you want to change the base?
Conversation
Thanks, this is a nice feature to add. I've had some trouble trying to match subdirectories in a long path. It looks like this is because filepath.Match does not handle the I've got a few minor comments I'll leave inline, other than that it looks good. If you could fix those and squash your commits I'll merge it. |
} | ||
} | ||
|
||
func TestRecursiveExcludes(t *testing.T) { |
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.
This test can be removed. I don't have Go installed in that directory (the test doesn't fail in that case btw), so it's not so useful. For now, I trust the implementation of filepath.Match and the previous tests should be enough to test that it's being used correctly.
I see you opened issue golang/go#11862 in the Go project regarding the |
Added --exclude option that mimics ctag's exclude flag. The pattern is expected to be a shell glob pattern (which is what Go's filepath.Match method expects). It can be set multiple times to set several filters. Once the file list is built, the patterns will be applied to each file to filter out any names that match the exclude patterns before processing. Note: Glob pattern '**' does not work recursively. See open issue golang/go#11862
6ab47cb
to
7c392cb
Compare
Changes made and squashed commits |
@jstemmer Just wanted to remind you that this is ready to go. |
Thanks - no worries. Looks like the feature request for the glob handling ** is being implemented too. I think it should just work when it lands but will be sure to test it when it does. |
the double star glob seems to have been rejected from the go-stdlib here's a self contained example of what I am proposing. |
Added --exclude option that mimics ctag's exclude flag. The pattern is expected to be a shell glob pattern (which is what Go's filepath.Match method expects). It can be set multiple times to set several filters. Once the file list is built, the patterns will be applied to each file to filter out any names that match the exclude patterns before processing.