.github/workflows, scripts: Improve checkpatch compliance

Use checkpatch --strict to detect more style issues.
This commit is contained in:
Gleb Chesnokov
2024-10-01 16:17:11 +03:00
parent 878bbad8ce
commit 1925094cb0
4 changed files with 25 additions and 17 deletions
+9 -5
View File
@@ -231,7 +231,7 @@ function run_checkpatch {
if [ "${multiple_patches}" = "false" ]; then
echo "Running checkpatch on the SCST kernel patch ..."
( cd "${outputdir}/linux-$1" \
&& scripts/checkpatch.pl --no-tree --no-signoff - < "${patchfile}" &> "${outputfile}")
&& scripts/checkpatch.pl --no-tree --no-signoff --strict - < "${patchfile}" &> "${outputfile}")
else
echo "Running checkpatch on the SCST kernel patches ..."
rm -f "${outputfile}"
@@ -239,17 +239,21 @@ function run_checkpatch {
&& for p in "${outputdir}/${patchdir}"/*
do
echo "==== $p" >>"${outputfile}"
scripts/checkpatch.pl --no-tree --no-signoff - < "$p" >> "${outputfile}" 2>&1
scripts/checkpatch.pl --no-tree --no-signoff --strict - < "$p" >> "${outputfile}" 2>&1
done
)
fi
errors=$(grep -c '^ERROR' "${outputfile}")
warnings=$(grep -c '^WARNING' "${outputfile}")
echo "${errors} errors / ${warnings} warnings."
grep -E '^WARNING|^ERROR' "${outputfile}" |
checks=$(grep -c '^CHECK' "${outputfile}")
echo "${errors} errors / ${warnings} warnings / ${checks} checks."
grep -E '^WARNING|^ERROR|^CHECK' "${outputfile}" |
sort |
grep -v 'WARNING: missing space after return type' |
sed 's/^WARNING: Avoid CamelCase:.*/WARNING: Avoid CamelCase/' |
sed 's/^CHECK: Avoid CamelCase:.*/CHECK: Avoid CamelCase/' |
uniq -c
else
echo "Skipping checkpatch step for kernel $1."