Skip to content

Use doublestar for glob matching#55

Open
shaxbee wants to merge 3 commits into
cespare:mainfrom
shaxbee:master
Open

Use doublestar for glob matching#55
shaxbee wants to merge 3 commits into
cespare:mainfrom
shaxbee:master

Conversation

@shaxbee

@shaxbee shaxbee commented Dec 17, 2018

Copy link
Copy Markdown

Enables glob patterns containing ** eg. **/*.go

Comment thread match.go Outdated
@shaxbee

shaxbee commented May 2, 2019

Copy link
Copy Markdown
Author

Noticed excludePrefix wasn't working with glob matcher. Added implementation and tests as well.

@shaxbee

shaxbee commented Aug 14, 2019

Copy link
Copy Markdown
Author

@cespare could you kindly review?

@shaxbee

shaxbee commented May 1, 2020

Copy link
Copy Markdown
Author

@cespare Is there anything preventing this PR from being reviewed?

@carrete

carrete commented May 1, 2020

Copy link
Copy Markdown

@shaxbee You may want to check out https://github.com/cortesi/modd

@cespare cespare left a comment

Copy link
Copy Markdown
Owner

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.

Comment thread match.go
case err != nil:
return false
case matches:
return true

Copy link
Copy Markdown
Owner

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.

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