summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-09-23 09:17:24 +0200
committerAntonio Cardace <acardace@redhat.com>2020-09-28 15:08:41 +0200
commit419be5d0e7cd5a107865b201cda93f926b5d526e (patch)
treec0857e19d1683c6e19b186683b216787390a3244 /contrib
parent76bb1f91a5e6941517e9e93261c70ed565dabc00 (diff)
checkpatch.pl: adjust checking for indentation/tabs
Our new format gets enforced by clang-format, and we now only use four space indentation, instead of tabs. Adjust the checkpatch script to account for that. Also, now there are probably no cases left where we want to see any tabs in our sources. Complain about any tabs we find.
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/scripts/checkpatch.pl16
1 files changed, 2 insertions, 14 deletions
diff --git a/contrib/scripts/checkpatch.pl b/contrib/scripts/checkpatch.pl
index 98693f8dc3..40518c8e72 100755
--- a/contrib/scripts/checkpatch.pl
+++ b/contrib/scripts/checkpatch.pl
@@ -190,19 +190,7 @@ complain ("XXX marker are reserved for development while work-in-progress. Use T
complain ("This gtk-doc annotation looks wrong") if $line =~ /\*.*\( *(transfer-(none|container|full)|allow none) *\) *(:|\()/;
complain ("Prefer nm_assert() or g_return*() to g_assert*()") if $line =~ /g_assert/ and not $filename =~ /\/tests\//;
complain ("Use gs_free_error with GError variables") if $line =~ /\bgs_free\b +GError *\*/;
-
-new_hunk if $_ eq '';
-my ($this_indent) = /^(\s*)/;
-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 if $_ ne '';
+#complain ("Use spaces instead of tabs") if $line =~ /\t/;
# Further on we process stuff without comments.
$_ = $line;
@@ -228,7 +216,7 @@ if (/^typedef*/) {
# A function name
my $name = $1;
- complain ('A single space should follow the function name') unless $2 eq ' ';
+ complain ('No space between function name and arguments') unless $2 eq '';
# Determine which function must not be preceding this one
foreach my $func (reverse @order) {