checkpatch.pl: warn if an adding line introduce spaces before tabs.
authorAlberto Panizzo <maramaopercheseimorto@gmail.com>
Fri, 5 Mar 2010 21:43:54 +0000 (13:43 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Mar 2010 19:26:44 +0000 (11:26 -0800)
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>
scripts/checkpatch.pl

index 1a93ac265c31e34f830174e2bcfce88e21b324fb..cf4e44cf3c27d5cc4758ab082ad26bd2aef0f903 100755 (executable)
@@ -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)$/);