Skip to content

Commit

Permalink
checkpatch.pl: warn if an adding line introduce spaces before tabs.
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Panizzo <[email protected]>
Cc: Andy Whitcroft <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Alberto Panizzo authored and torvalds committed Mar 6, 2010
1 parent 7940484 commit 08e4436
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,12 @@ sub process {
ERROR("code indent should use tabs where possible\n" . $herevet);
}

# check for space before tabs.
if ($rawline =~ /^\+/ && $rawline =~ / \t/) {
my $herevet = "$here\n" . cat_vet($rawline) . "\n";
WARN("please, no space before tabs\n" . $herevet);
}

# check we are in a valid C source file if not then ignore this hunk
next if ($realfile !~ /\.(h|c)$/);

Expand Down

0 comments on commit 08e4436

Please sign in to comment.