summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-16 15:38:01 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-16 15:58:13 -0800
commit42f32671a877bd5d0c36dcea5cc58220f1d47a82 (patch)
tree6540926b0b5b1eeeb229f1c3b44fd652b66e29f9 /scripts
parent6424b162f0f3ce74cd0d219efff52829c452d73c (diff)
downloadsubsurface-42f32671a877bd5d0c36dcea5cc58220f1d47a82.tar.gz
Continue to improve whitespace cleanup helper
The more I try the cleanup helper, the more corner cases I find... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/whitespace.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/whitespace.pl b/scripts/whitespace.pl
index ad5380442..fa4718649 100644
--- a/scripts/whitespace.pl
+++ b/scripts/whitespace.pl
@@ -3,7 +3,10 @@
my $input = $ARGV[0];
my $source = `clang-format $input`;
$source =~ s/^(.*each.*\(.*\).*)\n\s*{\s*$/$1 {/img;
-$source =~ s/^(\s*struct.*)\n\s*{\s*$/$1 {/img;
+$source =~ s/^(\s*struct[^()\n]*)\n\s*{\s*$/$1 {/img;
+$source =~ s/^(\s*static\s+struct[^()\n]*)\n\s*{\s*$/$1 {/img;
+$source =~ s/^(\s*union[^()\n]*)\n\s*{\s*$/$1 {/img;
+$source =~ s/^(\s*static\s+union[^()\n]*)\n\s*{\s*$/$1 {/img;
$source =~ s/^(\s*class.*)\n\s*{\s*$/$1 {/img;
$source =~ s/^(\S*::\S*.*)\n\s*: /$1 : /img;
$source =~ s/(?:\G|^)[ ]{6}/\t/mg;