Skip to content

checkpatch: improve exit criterias

Bjorn Andersson linux-arm-msm lkml 1 version In review

Get series with b4
b4 am 20261108-checkpatch-fixes-hash-v1-0-d49b3085c20b@oss.qualcomm.com change-id 20261108-checkpatch-fixes-hash-0466f2c1d2e4

Versions newest first

  1. v1 Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4checkpatch: don't stop at the first clean patch with --mailbackscripts/checkpatch.pl+1 -10 replies
2/4checkpatch: don't stop at the first non-patch input with --no-patchscripts/checkpatch.pl+1 -10 replies
3/4checkpatch: don't stop at the first empty inputscripts/checkpatch.pl+1 -10 replies
4/4checkpatch: fail on missing or unreadable files with --filescripts/checkpatch.pl+6 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] checkpatch: improve exit criterias

When invoking checkpatch with the --mailback argument over a range of patches the tool unexpectedly exits successfully on the first clean patch. For example:

./scripts/checkpatch.pl --mailback --git v7.3-rc1..

Checks the single commit and then exits successfully. In contrast, omitting --mailback causes checkpatch to check the thousands of commits in the range.

The same behavior can be observed with --no-patch or when empty patches are involved, which exits successfully after the first non-patch has passed the checks, either skipping further checks or failing to return a non-zero exit value even though errors has been reported.

Lastly, checkpatch fails with a non-zero status when invoked on a missing patch file, but zero when invoked on a missing file.

---
Bjorn Andersson (4):
checkpatch: don't stop at the first clean patch with --mailback
checkpatch: don't stop at the first non-patch input with --no-patch
checkpatch: don't stop at the first empty input
checkpatch: fail on missing or unreadable files with --file

 scripts/checkpatch.pl | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

---
base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b
change-id: 20261108-checkpatch-fixes-hash-0466f2c1d2e4

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>