]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tools: update checkpatch to allow indented labels
authorRenato Westphal <renato@opensourcerouting.org>
Sat, 20 Oct 2018 14:37:39 +0000 (11:37 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Sat, 27 Oct 2018 18:16:12 +0000 (16:16 -0200)
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 <renato@opensourcerouting.org>
tools/checkpatch.pl

index 3b861e4f87f8b51b44feaec691cd99e65076b1cd..22354c1e882b72478a5e31ce6db1dac89fa22794 100755 (executable)
@@ -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;