Skip to contentSkip to conversation

checkpatch.pl: warn if an adding line introduce spaces before tabs.

RFC New Alberto Panizzo 1 participant 1 message Jan 27, 2010 Checkpatch

lore
Share & tools
lore
#0 lore raw

RFC 1/1 checkpatch.pl: warn if an adding line introduce spaces before tabs.

This apply to the linux-next tree.

It is a useful thing to warn.

---
 scripts/checkpatch.pl |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
scripts/checkpatch.pl +6 -0
index bc4114f..ab18a11 100755
@@ -1411,6 +1411,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)$/);
 
Signature · 1 line
1.6.3.3