提交 08e44365 编写于 作者: A Alberto Panizzo 提交者: Linus Torvalds

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

Signed-off-by: NAlberto Panizzo <maramaopercheseimorto@gmail.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 79404849
...@@ -1422,6 +1422,12 @@ sub process { ...@@ -1422,6 +1422,12 @@ sub process {
ERROR("code indent should use tabs where possible\n" . $herevet); 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 # check we are in a valid C source file if not then ignore this hunk
next if ($realfile !~ /\.(h|c)$/); next if ($realfile !~ /\.(h|c)$/);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册