From 2288fec13e5fa8f1b2493fd75e35f748460b2039 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 22 Sep 2014 10:59:37 -0700 Subject: extras/checkpatch.pl: update coding guidelines script - Allow 'quoted string split across lines' since its a GlusterFS common practice - Remove a useless "+" - perl 5.20 complains with following warning "Useless use of greediness modifier '+'" Change-Id: Ibaf276ec84757b3ecc3e6db7f5e720b8e8a12dff BUG: 1120646 Signed-off-by: Harshavardhana Reviewed-on: http://review.gluster.org/8811 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy --- extras/checkpatch.pl | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'extras') diff --git a/extras/checkpatch.pl b/extras/checkpatch.pl index a19a1bb0bdf..5077f9adfb7 100755 --- a/extras/checkpatch.pl +++ b/extras/checkpatch.pl @@ -2091,17 +2091,6 @@ sub process { "line over $max_line_length characters\n" . $herecurr); } -# Check for user-visible strings broken across lines, which breaks the ability -# to grep for the string. Make exceptions when the previous string ends in a -# newline (multiple lines in one string constant) or '\t', '\r', ';', or '{' -# (common in inline assembly) or is a octal \123 or hexadecimal \xaf value - if ($line =~ /^\+\s*"/ && - $prevline =~ /"\s*$/ && - $prevrawline !~ /(?:\\(?:[ntr]|[0-7]{1,3}|x[0-9a-fA-F]{1,2})|;\s*|\{\s*)"\s*$/) { - WARN("SPLIT_STRING", - "quoted string split across lines\n" . $hereprev); - } - # check for spaces before a quoted newline if ($rawline =~ /^.*\".*\s\\n/) { if (WARN("QUOTED_WHITESPACE_BEFORE_NEWLINE", @@ -2128,7 +2117,7 @@ sub process { "please, no space before tabs\n" . $herevet) && $fix) { while ($fixed[$linenr - 1] =~ - s/(^\+.*) {8,8}+\t/$1\t\t/) {} + s/(^\+.*) {8,8}\t/$1\t\t/) {} while ($fixed[$linenr - 1] =~ s/(^\+.*) +\t/$1\t/) {} } -- cgit