Commit 08e4436566250cb98b3f3ac37643b1cf09481256
Committed by
Linus Torvalds
1 parent
79404849e9
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 6 additions and 0 deletions Side-by-side Diff
scripts/checkpatch.pl
... | ... | @@ -1422,6 +1422,12 @@ |
1422 | 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 | 1431 | # check we are in a valid C source file if not then ignore this hunk |
1426 | 1432 | next if ($realfile !~ /\.(h|c)$/); |
1427 | 1433 |