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/checkpatch.pl (1 of 2 files). Show all

Unified · Split

scripts/checkpatch.pl+9−5
@@ -51,7 +51,7 @@ my %ignore_type = (); · 50 unmodified lines
51my @ignore = ();51my @ignore = ();
52my $help = 0;52my $help = 0;
53my $configuration_file = ".checkpatch.conf";53my $configuration_file = ".checkpatch.conf";
54my $max_line_length = 80;54my $max_line_length = 100;
55my $ignore_perl_version = 0;55my $ignore_perl_version = 0;
56my $minimum_perl_version = 5.10.0;56my $minimum_perl_version = 5.10.0;
57my $min_conf_desc_length = 4;57my $min_conf_desc_length = 4;
@@ -97,9 +97,11 @@ Options: · 39 unmodified lines
97 --types TYPE(,TYPE2...) show only these comma separated message types97 --types TYPE(,TYPE2...) show only these comma separated message types
98 --ignore TYPE(,TYPE2...) ignore various comma separated message types98 --ignore TYPE(,TYPE2...) ignore various comma separated message types
99 --show-types show the specific message type in the output99 --show-types show the specific message type in the output
100 --max-line-length=n set the maximum line length, if exceeded, warn100 --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
101 --min-conf-desc-length=n set the min description length, if shorter, warn103 --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)
103 --root=PATH PATH to the kernel tree root105 --root=PATH PATH to the kernel tree root
104 --no-summary suppress the per-file summary106 --no-summary suppress the per-file summary
105 --mailback only produce a report in case of warnings/errors107 --mailback only produce a report in case of warnings/errors
@@ -3240,8 +3242,10 @@ sub process { · 3134 unmodified lines
3240 3242
3241 if ($msg_type ne "" &&3243 if ($msg_type ne "" &&
3242 (show_type("LONG_LINE") || show_type($msg_type))) {3244 (show_type("LONG_LINE") || show_type($msg_type))) {
3243 WARN($msg_type,3245 my $msg_level = \&WARN;
3244 "line over $max_line_length characters\n" . $herecurr);3246 $msg_level = \&CHK if ($file);
3247 &{$msg_level}($msg_type,
3248 "line length of $length exceeds $max_line_length columns\n" . $herecurr);
3245 }3249 }
3246 }3250 }
3247 3251