-
Notifications
You must be signed in to change notification settings - Fork 349
Revert "checkpatch: remove and use clang-format instead" #10692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,27 @@ | ||||||||||||||||
| #!/bin/sh | ||||||||||||||||
| # SPDX-License-Identifier: BSD-3-Clause | ||||||||||||||||
|
|
||||||||||||||||
| set -e | ||||||||||||||||
|
|
||||||||||||||||
| # The purpose of this script is not to stop on the first checkpatch | ||||||||||||||||
| # failure and report at the end instead. | ||||||||||||||||
| # | ||||||||||||||||
| # Sample invocation: | ||||||||||||||||
| # $0 --codespell --strict < PR_SHAs.txt | ||||||||||||||||
| main() | ||||||||||||||||
| { | ||||||||||||||||
| local failures=0 | ||||||||||||||||
| while read -r sha ; do | ||||||||||||||||
| printf '\n -------------- \n\n' | ||||||||||||||||
| ./scripts/checkpatch.pl $@ -g $sha || failures=$((failures+1)) | ||||||||||||||||
|
||||||||||||||||
| ./scripts/checkpatch.pl $@ -g $sha || failures=$((failures+1)) | |
| ./scripts/checkpatch.pl "$@" -g "$sha" || failures=$((failures+1)) |
Copilot
AI
Apr 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script returns the number of failures as the process exit status. Shell exit codes are limited to 0–255, so large PRs could overflow/wrap and potentially misreport success/failure. Consider exiting with 1 when any failure occurred (and 0 otherwise), while still printing the full summary.
| fi | |
| return $failures | |
| return 1 | |
| fi | |
| return 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkpatch_list.shis declared with#!/bin/shbut useslocalinsidemain(), which is not POSIX and will fail on Ubuntu where/bin/shisdash. Either switch the shebang to bash or removelocalusage to keep the script portable.