[Github] Skip MIR files for undef check (#120919)

This patch skips checking files with a .mir extension for the presence
of undef. This was creating false positives that got reported on
discourse.
This commit is contained in:
Aiden Grossman 2024-12-24 01:09:34 -08:00 committed by GitHub
parent ccbbacf0fa
commit c84f5a9e00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -379,6 +379,10 @@ You can test this locally with the following command:
# Each file is prefixed like:
# diff --git a/file b/file
for file in re.split("^diff --git ", stdout, 0, re.MULTILINE):
# We skip checking in MIR files as undef is a valid token and not
# going away.
if file.endswith(".mir"):
continue
# search for additions of undef
if re.search(r"^[+](?!\s*#\s*).*(\bundef\b|UndefValue::get)", file, re.MULTILINE):
files.append(re.match("a/([^ ]+)", file.splitlines()[0])[1])