From: Renato Westphal Date: Sat, 20 Oct 2018 14:37:39 +0000 (-0300) Subject: tools: update checkpatch to allow indented labels X-Git-Tag: frr-7.1-dev~228^2~3 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=12d35cedf5253f72f1f0aa32ffc2cf68a250a41d;p=matthieu%2Ffrr.git tools: update checkpatch to allow indented labels clang-format always indent labels by default and that can't be changed with any configuration option. Also, indented labels tend to improve code readability, especially in long functions. Signed-off-by: Renato Westphal --- diff --git a/tools/checkpatch.pl b/tools/checkpatch.pl index 3b861e4f87..22354c1e88 100755 --- a/tools/checkpatch.pl +++ b/tools/checkpatch.pl @@ -4519,17 +4519,6 @@ sub process { } } -#goto labels aren't indented, allow a single space however - if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and - !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) { - if (WARN("INDENTED_LABEL", - "labels should not be indented\n" . $herecurr) && - $fix) { - $fixed[$fixlinenr] =~ - s/^(.)\s+/$1/; - } - } - # return is not a function if (defined($stat) && $stat =~ /^.\s*return(\s*)\(/s) { my $spacing = $1;