-
-
Notifications
You must be signed in to change notification settings - Fork 438
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 trailing single asterisk matching subdirs #1650
Changes from all commits
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 |
---|---|---|
|
@@ -316,7 +316,7 @@ def sep(s: str) -> str: | |
(r"\*\*+[^/]+", None), # Can't have **x | ||
(r"\*\*/\*\*", None), # Can't have **/** | ||
(r"^\*+/", r"(.*[/\\\\])?"), # ^*/ matches any prefix-slash, or nothing. | ||
(r"/\*+$", r"[/\\\\].*"), # /*$ matches any slash-suffix. | ||
(r"/\*\*+$", r"[/\\\\].*"), # /**$ matches any slash-suffix. | ||
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. @nedbat at first I thought I'd just send a test case demonstrating the problem, but then, I thought it should be easy to fix, so I've added this change as well. I don't know if there was a motivation for things to work as they do, but hopefully this can improve the behavior and match it with what's documented… |
||
(r"\*\*/", r"(.*[/\\\\])?"), # **/ matches any subdirs, including none | ||
(r"/", r"[/\\\\]"), # / matches either slash or backslash | ||
(r"\*", r"[^/\\\\]*"), # * matches any number of non slash-likes | ||
|
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.
@nedbat I wonder if this has the same problem with the prefix..