[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOJsxLEBWXjUj9FUwg=9dXvkJeD8Eo7NL4kgObO6MH+duf8fQQ@mail.gmail.com>
Date: Sat, 4 Feb 2012 21:32:32 +0200
From: Pekka Enberg <penberg@...nel.org>
To: Joe Perches <joe@...ches.com>
Cc: Ingo Molnar <mingo@...e.hu>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andy Whitcroft <apw@...dowen.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Cyrill Gorcunov <gorcunov@...nvz.org>,
linux-kernel@...r.kernel.org,
Pavel Emelyanov <xemul@...allels.com>,
Serge Hallyn <serge.hallyn@...onical.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Kees Cook <keescook@...omium.org>, Tejun Heo <tj@...nel.org>,
Andrew Vagin <avagin@...nvz.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Alexey Dobriyan <adobriyan@...il.com>,
Andi Kleen <andi@...stfloor.org>,
KOSAKI Motohiro <kosaki.motohiro@...il.com>,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Glauber Costa <glommer@...allels.com>,
Matt Helsley <matthltc@...ibm.com>,
Eric Dumazet <eric.dumazet@...il.com>,
Vasiliy Kulikov <segoon@...nwall.com>, Valdis.Kletnieks@...edu
Subject: Re: [PATCH, v2] checkpatch: Warn on code with 6+ tab indentation,
remove 80col warning
On Sat, Feb 4, 2012 at 9:27 PM, Joe Perches <joe@...ches.com> wrote:
>> The practical downsides of the current warning are much more severe. I
>> personally don't use checkpatch much these days because of the silly
>> fixed limit.
>
> More likely you developed a keen sense of
> kernel style appropriateness and don't need
> any checkpatch nannying.
No, it just means more trivially fixable issues slip through the cracks.
On Sat, Feb 4, 2012 at 9:27 PM, Joe Perches <joe@...ches.com> wrote:
> I don't disagree with something like setting
> the normally allowed line length to 100 and
> maybe keeping a --strict limit to 80.
>
> Something like:
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 2b52aeb..7602bce 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -34,6 +34,9 @@ my @ignore = ();
> my $help = 0;
> my $configuration_file = ".checkpatch.conf";
>
> +my $max_line_length_warn = 100; # normal cases
> +my $max_line_length_strict = 80; # when using --strict
> +
> sub help {
> my ($exitcode) = @_;
>
> @@ -1726,15 +1729,19 @@ sub process {
> # check we are in a valid source file if not then ignore this hunk
> next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
>
> -#80 column limit
> +# check line length limit
> if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
> $rawline !~ /^.\s*\*\s*\@$Ident\s/ &&
> !($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(KERN_\S+\s*|[^"]*))?"[X\t]*"\s*(?:|,|\)\s*;)\s*$/ ||
> - $line =~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) &&
> - $length > 80)
> - {
> - WARN("LONG_LINE",
> - "line over 80 characters\n" . $herecurr);
> + $line =~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) {
> + if ($length > $max_line_len_strict) {
> + CHK("LONG_LINE",
> + "line over $max_line_len_strict characters\n" . $herecurr);
> + }
> + if ($length > $max_line_len_warn) {
> + WARN("LONG_LINE",
> + "line over $max_line_len_warn characters\n" . $herecurr);
> + }
> }
>
> # check for spaces before a quoted newline
I'm fine with something like this too.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists