checkpatch: detect some whitespace errors

Vim's trademark.
This commit is contained in:
Lubomir Rintel 2018-09-18 18:44:21 +02:00
parent 511709c54d
commit 66ddc92135

View file

@ -58,10 +58,12 @@ our @functions_seen;
our $type;
our $filename;
our $line_no;
our $indent;
sub new_hunk
{
$type = undef;
$indent = "";
}
sub new_file
@ -139,6 +141,10 @@ s/\s*\/\/.*//;
/^\s* \* / and next;
new_hunk if $_ eq '';
my ($this_indent) = /^(\s*)/;
complain ('Bad indentation') if $this_indent =~ /^$indent\t+ +/;
$indent = $this_indent;
if (/^typedef*/) {
# We expect the { on the same line as the typedef. Otherwise it
# looks too much like a function declaration