Re: [PATCH] checkpatch: Warn on code with 6+ tab indentation

From: Eric W. Biederman
Date: Fri Feb 03 2012 - 21:38:13 EST


Joe Perches <joe@xxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/