lkml.org 
[lkml]   [2012]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] checkpatch: Warn on code with 6+ tab indentation
Date
Joe Perches <joe@perches.com> writes:

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 2b52aeb..89d24b3 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1924,6 +1924,12 @@ sub process {
> my $pre_ctx = "$1$2";
>
> my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0);
> +
> + if ($line =~ /^\+\t{6,}/) {
> + WARN("DEEP_INDENTATION",
> + "Too many leading tabs - consider code refactoring\n" . $herecurr);
> + }

By any chance have you run this patch against itself? I find it comical
that there is a line 104 characters long suggesting people use shorter
lines.

> my $ctx_cnt = $realcnt - $#ctx - 1;
> my $ctx = join("\n", @ctx);
>

Eric


\
 
 \ /
  Last update: 2012-02-04 03:41    [from the cache]
©2003-2011 Jasper Spaans