scripts: ci: check_compliance: ignore patch and diff files

Was getting several false positives about whitespace at line
endings with check_compliance.py because it was analyzing
.patch and .diff files as source.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
This commit is contained in:
Chris Friedt 2025-01-15 12:19:37 -08:00 committed by Benjamin Cabé
commit 305e648d63

View file

@ -224,7 +224,7 @@ class CheckPatch(ComplianceTest):
cmd = [checkpatch]
cmd.extend(['--mailback', '--no-tree', '-'])
diff = subprocess.Popen(('git', 'diff', '--no-ext-diff', COMMIT_RANGE),
diff = subprocess.Popen(('git', 'diff', '--no-ext-diff', '--', ':!*.diff', ':!*.patch', COMMIT_RANGE),
stdout=subprocess.PIPE,
cwd=GIT_TOP)
try:
@ -1327,7 +1327,7 @@ class GitDiffCheck(ComplianceTest):
for shaidx in get_shas(COMMIT_RANGE):
# Ignore non-zero return status code
# Reason: `git diff --check` sets the return code to the number of offending lines
diff = git("diff", f"{shaidx}^!", "--check", ignore_non_zero=True)
diff = git("diff", f"{shaidx}^!", "--check", "--", ":!*.diff", ":!*.patch", ignore_non_zero=True)
lines = p.findall(diff)
lines = map(lambda x: f"{shaidx}: {x}", lines)