checkpatch: add commit-message field to ignore some check

The script 'checkpatch.pl' is part of the automatic tests used by
Linux Maintainers and developers to test new patches.
The Linux development process is e-mail base. An error reported by
checkpatch is not a blocking point; the developer can explain in
the e-mail why he is submitting a patch that fails at checkpatch
or that is in violation of the coding style. It's up to the
maintainer to decide to accept or reject the explanation and then
the patch.

The OpenOCD development process relies on Gerrit and Jenkins as
front-end tools. Jenkins tests every new patch with checkpatch
and then builds the new code. If checkpatch fails, Jenkins adds a
failure label to the patch; this often causes the patch to get
ignored by maintainers that considers it as 'not ready'.

Checkpatch can be instrumented to ignore some test, but this has
to be specified in the command line or in the configuration file.

Let checkpatch extract from the patch's commit message the new
field 'Checkpatch-ignore:' that lists the additional tests that
has to be ignored for that patch only.
The developer that detects as error or a limitation in checkpatch
can add the field and the problematic test in the commit message
and re-push the patch.
The maintainer should check the list of tests and decide how to
proceed.

Change-Id: Iafc1b2893a07c7b3fc7e3ad15bd694aba9bd8519
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6169
Tested-by: jenkins
This commit is contained in:
Antonio Borneo 2021-04-16 23:57:06 +02:00
parent 1c1fd1a71a
commit 4963087013
1 changed files with 7 additions and 0 deletions

View File

@ -3011,6 +3011,13 @@ sub process {
} }
} }
# OpenOCD specific: Begin: Extend list of checkpatch tests to ignore
if ($in_commit_log && $line =~ /^\s*Checkpatch-ignore:\s*(.*)/) {
my @array = split(/[\s,]+/, $1);
hash_save_array_words(\%ignore_type, \@array);
}
# OpenOCD specific: End
# Check for patch separator # Check for patch separator
if ($line =~ /^---$/) { if ($line =~ /^---$/) {
$has_patch_separator = 1; $has_patch_separator = 1;