[llvm] Github Automation: Add support for an optional colon after command name (PR #66540)
Jon Roelofs via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 22 10:10:49 PDT 2023
================
@@ -572,12 +572,12 @@ def execute_command(self) -> bool:
"""
This function reads lines from STDIN and executes the first command
that it finds. The 2 supported commands are:
- /cherry-pick commit0 <commit1> <commit2> <...>
- /branch <owner>/<repo>/<branch>
+ /cherry-pick<:> commit0 <commit1> <commit2> <...>
+ /branch<:> <owner>/<repo>/<branch>
"""
for line in sys.stdin:
line.rstrip()
- m = re.search(r"/([a-z-]+)\s(.+)", line)
+ m = re.search(r"/([a-z-]+)(?::)?\s(.+)", line)
----------------
jroelofs wrote:
How about:
```suggestion
m = re.search(r"/([a-z-]+):?\s(.+)", line)
```
Then the reader doesn't have to remember the rules for `(?:...)`s
https://github.com/llvm/llvm-project/pull/66540
More information about the llvm-commits
mailing list