checkpatch: only report error on hit

The Linux checkpatch script used by OpenOCD reports hits either as
error, warning and check.
Such classification is meaningful for Linux maintainers, but for
OpenOCD Jenkins they are all considered as errors.

Having such classification in the checkpatch report by Jenkins is
misleading for developers that expect 'warnings' to be probably
ignored by maintainers, while having no idea what 'checks' means.

This patch flattens all the checkpatch reports to 'error' only.

Checkpatch can trigger false positives. OpenOCD uses the tag
	Checkpatch-ignore:
in the commit message to prevent Jenkins to report the error, as
described in HACKING.

Change-Id: I1d3164ba1f725c0763dfe362192ffa669b3856e6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8424
Reviewed-by: Karl Palsson <karlp@tweak.au>
Tested-by: jenkins
This commit is contained in:
Antonio Borneo 2024-08-01 10:43:41 +02:00
parent bfd3110e59
commit ceae51ad74
1 changed files with 10 additions and 0 deletions

View File

@ -2384,6 +2384,10 @@ sub show_type {
sub report {
my ($level, $type, $msg) = @_;
# OpenOCD specific: Begin: Flatten ERROR, WARNING and CHECK as ERROR
$level = 'ERROR';
# OpenOCD specific: End
if (!show_type($type) ||
(defined $tst_only && $msg !~ /\Q$tst_only\E/)) {
return 0;
@ -7638,9 +7642,15 @@ sub process {
print report_dump();
if ($summary && !($clean == 1 && $quiet == 1)) {
print "$filename " if ($summary_file);
if (!$OpenOCD) {
print "total: $cnt_error errors, $cnt_warn warnings, " .
(($check)? "$cnt_chk checks, " : "") .
"$cnt_lines lines checked\n";
} # $OpenOCD
# OpenOCD specific: Begin: Report total as errors
my $total = $cnt_error + $cnt_warn + $cnt_chk;
print "total: $total errors, $cnt_lines lines checked\n";
# OpenOCD specific: End
}
if ($quiet == 0) {