History

checkpatch: add --strict test for concatenated string elements

Using a space between concatenated string elements is easier for a human to read. ie: "String"FOO"bar" is easier to read as: "String" FOO "bar" So suggest this style with a --strict command line option.

Joe Perches committed 12 years ago

Commit f17dba41 parent 56193271 file · +6 −0Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+6−0
@@ -4344,6 +4344,12 @@ sub process { · 4343 unmodified lines
4344 "Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr);4344 "Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr);
4345 }4345 }
4346 4346
4347# concatenated string without spaces between elements
4348 if ($line =~ /"X+"[A-Z_]+/ || $line =~ /[A-Z_]+"X+"/) {
4349 CHK("CONCATENATED_STRING",
4350 "Concatenated strings should use spaces between elements\n" . $herecurr);
4351 }
4352
4347# warn about #if 04353# warn about #if 0
4348 if ($line =~ /^.\s*\#\s*if\s+0\b/) {4354 if ($line =~ /^.\s*\#\s*if\s+0\b/) {
4349 CHK("REDUNDANT_CODE",4355 CHK("REDUNDANT_CODE",