-
Notifications
You must be signed in to change notification settings - Fork 135
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
Use doublestar for glob matching #55
base: main
Are you sure you want to change the base?
Conversation
Noticed excludePrefix wasn't working with glob matcher. Added implementation and tests as well. |
@cespare could you kindly review? |
@cespare Is there anything preventing this PR from being reviewed? |
@shaxbee You may want to check out https://github.com/cortesi/modd |
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.
@cespare Is there anything preventing this PR from being reviewed?
Sorry, I find it hard to get excited about this because I've never needed this feature (and because it adds a dependency).
This would also need documentation.
case err != nil: | ||
return false | ||
case matches: | ||
return true |
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.
The documentation for the ExcludePrefix method says:
// ExcludePrefix returns whether all paths with this prefix cannot match.
// It is allowed to return false negatives but not false positives.
That is not what this function implements. For example, if the pattern is **/
, that matches the prefix a/
but does not match the path a/b.txt
. So this would incorrectly exclude a/b.txt
from the watch.
It's not immediately obvious to me how to fix this problem. I designed the ExcludePrefix mechanism mostly with regexp matching in mind.
Enables glob patterns containing
**
eg.**/*.go