Skip to content

Commit 305e648

Browse files
cfriedtkartben
authored andcommitted
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 <[email protected]>
1 parent 651ecab commit 305e648

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/ci/check_compliance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def run(self):
224224
cmd = [checkpatch]
225225

226226
cmd.extend(['--mailback', '--no-tree', '-'])
227-
diff = subprocess.Popen(('git', 'diff', '--no-ext-diff', COMMIT_RANGE),
227+
diff = subprocess.Popen(('git', 'diff', '--no-ext-diff', '--', ':!*.diff', ':!*.patch', COMMIT_RANGE),
228228
stdout=subprocess.PIPE,
229229
cwd=GIT_TOP)
230230
try:
@@ -1327,7 +1327,7 @@ def run(self):
13271327
for shaidx in get_shas(COMMIT_RANGE):
13281328
# Ignore non-zero return status code
13291329
# Reason: `git diff --check` sets the return code to the number of offending lines
1330-
diff = git("diff", f"{shaidx}^!", "--check", ignore_non_zero=True)
1330+
diff = git("diff", f"{shaidx}^!", "--check", "--", ":!*.diff", ":!*.patch", ignore_non_zero=True)
13311331

13321332
lines = p.findall(diff)
13331333
lines = map(lambda x: f"{shaidx}: {x}", lines)

0 commit comments

Comments
 (0)