summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-09-23 09:17:24 +0200
committerThomas Haller <thaller@redhat.com>2020-09-23 09:44:25 +0200
commit54a91b9c31098bf3d83637b62099953e39f884a1 (patch)
treef219394c1b82f12d4d1a328deb8e7b7560183efc
parent8b021a3693fed048c5a2d51bbb311a4c18a526ca (diff)
downloadNetworkManager-th/ac/clang-format.tar.gz
checkpatch.pl: adjust checking for indentation/tabsth/ac/clang-format
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.
-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) {