summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2018-09-24 13:47:21 +0200
committerLubomir Rintel <lkundrak@v3.sk>2018-10-07 15:46:02 +0200
commit37212ce9b64be91c597ea7515e4a9fa1a18151b1 (patch)
treebfd47b5fa7758c132595aa8471af76fc74f92f83
parente7a511a54fdc8da91751b9913c8197955d76c155 (diff)
contrib/checkpatch: check some more whitespace trouble
-rwxr-xr-xcontrib/scripts/checkpatch.pl10
1 files changed, 9 insertions, 1 deletions
diff --git a/contrib/scripts/checkpatch.pl b/contrib/scripts/checkpatch.pl
index 6d997295e..289dad82e 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.