[llvm] 0c62920 - undef reviewer: tweak the regex so it doesn't warn about #undef
Nuno Lopes via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 20 11:48:29 PST 2024
Author: Nuno Lopes
Date: 2024-12-20T19:48:23Z
New Revision: 0c629206b0b3e1ddd64104a56c7a573a55e8944a
URL: https://github.com/llvm/llvm-project/commit/0c629206b0b3e1ddd64104a56c7a573a55e8944a
DIFF: https://github.com/llvm/llvm-project/commit/0c629206b0b3e1ddd64104a56c7a573a55e8944a.diff
LOG: undef reviewer: tweak the regex so it doesn't warn about #undef
Added:
Modified:
llvm/utils/git/code-format-helper.py
Removed:
################################################################################
diff --git a/llvm/utils/git/code-format-helper.py b/llvm/utils/git/code-format-helper.py
index 19264bca6ce8f6..36fc5ee4c3d527 100755
--- a/llvm/utils/git/code-format-helper.py
+++ b/llvm/utils/git/code-format-helper.py
@@ -380,7 +380,7 @@ def format_run(self, changed_files: List[str], args: FormatArgs) -> Optional[str
#
diff --git a/file b/file
for file in re.split("^
diff --git ", stdout, 0, re.MULTILINE):
# search for additions of undef
- if re.search("^[+].*" + regex, file, re.MULTILINE):
+ if re.search(r"^[+](?!\s*#\s*).*(\bundef\b|UndefValue::get)", file, re.MULTILINE):
files.append(re.match("a/([^ ]+)", file.splitlines()[0])[1])
if not files:
More information about the llvm-commits
mailing list