diff options
| author | Lubomir Rintel <lkundrak@v3.sk> | 2018-09-24 13:47:21 +0200 |
|---|---|---|
| committer | Lubomir Rintel <lkundrak@v3.sk> | 2018-10-07 15:46:02 +0200 |
| commit | 587f00669012b86edf5fc56723be051b7f5572d0 (patch) | |
| tree | bfd47b5fa7758c132595aa8471af76fc74f92f83 /contrib | |
| parent | 1d57aefa41b752f87e2a8ac2a46f1a98c54cc20d (diff) | |
| download | NetworkManager-587f00669012b86edf5fc56723be051b7f5572d0.tar.gz | |
contrib/checkpatch: check some more whitespace trouble
Diffstat (limited to 'contrib')
| -rwxr-xr-x | contrib/scripts/checkpatch.pl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/contrib/scripts/checkpatch.pl b/contrib/scripts/checkpatch.pl index 6d997295e2..289dad82e9 100755 --- a/contrib/scripts/checkpatch.pl +++ b/contrib/scripts/checkpatch.pl @@ -135,7 +135,15 @@ complain ("Don't use space inside elvis operator ?:") if $line =~ /\?[\t ]+:/; new_hunk if $_ eq ''; my ($this_indent) = /^(\s*)/; -complain ("Bad indentation") if defined $indent and $this_indent =~ /^$indent\t+ +/; +if (defined $indent) { + my $this_tabs_before_spaces = length $1 if $this_indent =~ /^(\t*) +/; + my $tabs_before_spaces = length $1 if $indent =~ /^(\t*) +/; + + complain ("Bad indentation") + if $this_indent =~ /^$indent\t+ +/ + or (defined $tabs_before_spaces and defined $this_tabs_before_spaces + and $this_tabs_before_spaces < $tabs_before_spaces); +} $indent = $this_indent; # Further on we process stuff without comments. |
