History

checkpatch/coding-style: deprecate 80-column warning

Yes, staying withing 80 columns is certainly still _preferred_. But it's not the hard limit that the checkpatch warnings imply, and other concerns can most certainly dominate. Increase the default limit to 100 characters. Not because 100 characters is some hard limit either, but that's certainly a "what are you doing" kind of value and less likely to be about the occasional slightly longer lines. Miscellanea: - to avoid unnecessary whitespace changes in files, checkpatch will no longer emit a warning about line length when scanning files unless --strict is also used - Add a bit to coding-style about alignment to open parenthesis

Joe Perches committed 6 years ago

Commit bdc48fa1 parent 8fc984a2 files · +23 −14Browse files

Showing the changes to scripts (1 of 2 files). Show all

Unified · Split

scripts/checkpatch.pl+9−5
@@ -51,7 +51,7 @@ my %ignore_type = (); · 50 unmodified lines
5151 my @ignore = ();
5252 my $help = 0;
5353 my $configuration_file = ".checkpatch.conf";
54−my $max_line_length = 80;
54+my $max_line_length = 100;
5555 my $ignore_perl_version = 0;
5656 my $minimum_perl_version = 5.10.0;
5757 my $min_conf_desc_length = 4;
@@ -97,9 +97,11 @@ Options: · 39 unmodified lines
9797 --types TYPE(,TYPE2...) show only these comma separated message types
9898 --ignore TYPE(,TYPE2...) ignore various comma separated message types
9999 --show-types show the specific message type in the output
100− --max-line-length=n set the maximum line length, if exceeded, warn
100+ --max-line-length=n set the maximum line length, (default $max_line_length)
101+ if exceeded, warn on patches
102+ requires --strict for use with --file
101103 --min-conf-desc-length=n set the min description length, if shorter, warn
102− --tab-size=n set the number of spaces for tab (default 8)
104+ --tab-size=n set the number of spaces for tab (default $tabsize)
103105 --root=PATH PATH to the kernel tree root
104106 --no-summary suppress the per-file summary
105107 --mailback only produce a report in case of warnings/errors
@@ -3240,8 +3242,10 @@ sub process { · 3134 unmodified lines
32403242
32413243 if ($msg_type ne "" &&
32423244 (show_type("LONG_LINE") || show_type($msg_type))) {
3243− WARN($msg_type,
3244− "line over $max_line_length characters\n" . $herecurr);
3245+ my $msg_level = \&WARN;
3246+ $msg_level = \&CHK if ($file);
3247+ &{$msg_level}($msg_type,
3248+ "line length of $length exceeds $max_line_length columns\n" . $herecurr);
32453249 }
32463250 }
32473251