Re: [PATCH] checkpatch: Look for Kconfig indentation errors
From: Joe Perches
Date: Tue Dec 03 2019 - 04:39:31 EST
On Tue, 2019-12-03 at 11:23 +0200, Jani Nikula wrote:
> Alternatively, perhaps you could complain about indentation that is not
> one of 1) empty string, 2) exactly one tab, or 3) exactly one tab
> followed by exactly two spaces?
Way too many false positives.
Try something like:
$ git grep -P -oh "^\s*\w+\b" -- '*/Kconfig*' | \
perl -p -e 'my $tabs=0;my $spaces=0;while ($_ =~ /^\s/) { if (substr($_,0,1) eq " ") { $spaces++; } else { $tabs++; } $_ = substr($_, 1); } print "tabs: $tabs spaces: $spaces: word: $_";'