mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-31 09:00:13 +01:00
contrib/checkpatch: correctly separate indentation across hunks
This commit is contained in:
parent
0cb5c4f611
commit
1d57aefa41
1 changed files with 6 additions and 6 deletions
|
|
@ -63,7 +63,7 @@ our $indent;
|
|||
sub new_hunk
|
||||
{
|
||||
$type = undef;
|
||||
$indent = "";
|
||||
$indent = undef;
|
||||
}
|
||||
|
||||
sub new_file
|
||||
|
|
@ -133,17 +133,17 @@ complain ("Don't use \"unsigned int\" but just use \"unsigned\"") if $line =~ /\
|
|||
complain ("Please use LGPL2+ for new files") if $is_patch and $line =~ /under the terms of the GNU General Public License/;
|
||||
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+ +/;
|
||||
$indent = $this_indent;
|
||||
|
||||
# Further on we process stuff without comments.
|
||||
$_ = $line;
|
||||
s/\s*\/\*.*\*\///;
|
||||
s/\s*\/\*.*//;
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue