mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[GH1] replace globs with patterns that mergebot can process (#81414)
https://github.com/pytorch/pytorch/pull/81330#issuecomment-1182345751 shouldn't have happened and should have matched the linalg rule. The reason it happened is cuz we don't treat the patterns like globs. We may follow this up with a BE change to make the patterns be treated more like globs, which I expected originally. Pull Request resolved: https://github.com/pytorch/pytorch/pull/81414 Approved by: https://github.com/malfet
This commit is contained in:
committed by
PyTorch MergeBot
parent
270069cfb9
commit
c67a4d8a65
8
.github/scripts/gitutils.py
vendored
8
.github/scripts/gitutils.py
vendored
@ -305,8 +305,8 @@ def patterns_to_regex(allowed_patterns: List[str]) -> Any:
|
||||
"""
|
||||
pattern is glob-like, i.e. the only special sequences it has are:
|
||||
- ? - matches single character
|
||||
- * - matches any non-folder separator characters
|
||||
- ** - matches any characters
|
||||
- * - matches any non-folder separator characters or no character
|
||||
- ** - matches any characters or no character
|
||||
Assuming that patterns are free of braces and backslashes
|
||||
the only character that needs to be escaped are dot and plus
|
||||
"""
|
||||
@ -324,9 +324,9 @@ def patterns_to_regex(allowed_patterns: List[str]) -> Any:
|
||||
elif c == "*":
|
||||
if pattern_.peek() == "*":
|
||||
next(pattern_)
|
||||
rc += ".+"
|
||||
rc += ".*"
|
||||
else:
|
||||
rc += "[^/]+"
|
||||
rc += "[^/]*"
|
||||
else:
|
||||
rc += c
|
||||
rc += ")"
|
||||
|
Reference in New Issue
Block a user