diff options
author | Alberto Panizzo <maramaopercheseimorto@gmail.com> | 2010-03-05 16:43:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-06 14:26:44 -0500 |
commit | 08e4436566250cb98b3f3ac37643b1cf09481256 (patch) | |
tree | c669f150a8db7cacdcb7a720d61937f08d96d8c1 /scripts | |
parent | 79404849e90a41ea2109bd0e2f7c7164b0c4ce73 (diff) |
checkpatch.pl: warn if an adding line introduce spaces before tabs.
Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1a93ac265c31..cf4e44cf3c27 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -1422,6 +1422,12 @@ sub process { | |||
1422 | ERROR("code indent should use tabs where possible\n" . $herevet); | 1422 | ERROR("code indent should use tabs where possible\n" . $herevet); |
1423 | } | 1423 | } |
1424 | 1424 | ||
1425 | # check for space before tabs. | ||
1426 | if ($rawline =~ /^\+/ && $rawline =~ / \t/) { | ||
1427 | my $herevet = "$here\n" . cat_vet($rawline) . "\n"; | ||
1428 | WARN("please, no space before tabs\n" . $herevet); | ||
1429 | } | ||
1430 | |||
1425 | # check we are in a valid C source file if not then ignore this hunk | 1431 | # check we are in a valid C source file if not then ignore this hunk |
1426 | next if ($realfile !~ /\.(h|c)$/); | 1432 | next if ($realfile !~ /\.(h|c)$/); |
1427 | 1433 | ||