-
-
Notifications
You must be signed in to change notification settings - Fork 643
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
Fix Go source excludes; Cleanup old filespec matching #4350
Changes from 13 commits
430c5a1
405e119
055dbfc
227aa8c
f5a661f
40d37b5
62700f1
9664a29
a358cd6
495623e
f0f3513
25dfc5d
6b6cc3e
16a576a
9e83138
3213d70
0dc9db8
18c91d4
a501d6a
8a231a6
6e8e7dc
a8eb245
1ad6a97
39cba5a
db98f0b
25385a4
867057a
66ecd63
8435198
5df0d63
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ def glob_to_regex(pattern): | |
:returns: A regex string that matches same paths as the input glob does. | ||
""" | ||
out = ['^'] | ||
components = pattern.strip('/').replace('.', '[.]').split('/') | ||
components = pattern.strip('/').replace('.', '[.]').replace('$', '[$]').split('/') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it might make sense to consider a more general escape mechanism. This covers Initially I was thinking we could just drop Maybe on line: 37 https://github.com/pantsbuild/pants/pull/4350/files#diff-2d528bdfb8ee22a56a1b0660753b7a3cR37 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've been operating under the assumption that this code doesn't need to live very long with the v2 engine on the way. But if it does, this should probably switch to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the time when this logic was introduced, pathspec was still using gitignore syntax which is different from glob matching syntax. I am not sure whether pathspec has evolved to support glob matching syntax since. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. Tried |
||
doublestar = False | ||
for component in components: | ||
if len(out) == 1: | ||
|
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'm not sure that this is a legal glob... should it be
*/**/*
? Should check that it still compiles in latest master now that v2 is enabled.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.
test case added to prove the case.