summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarshavardhana <harsha@harshavardhana.net>2014-09-22 10:59:37 -0700
committerHarshavardhana <harsha@harshavardhana.net>2014-09-23 12:29:17 -0700
commit2288fec13e5fa8f1b2493fd75e35f748460b2039 (patch)
tree3eb502d41f796c006fdf76290e02c318038f13d6
parent6ddfdde6fb8de21c46442b4b6b15d5b6b1eff4e4 (diff)
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 <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8811 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
-rwxr-xr-xextras/checkpatch.pl13
1 files changed, 1 insertions, 12 deletions
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/) {}
}