mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 07:43:23 +00:00
ebac81b784
The struct / class regex was way too relaxed. Having the parent class on the same line usually looks better. clang-format appears to do something odd with continuation strings - even with UseTab: Always it indents those with four spaces. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 lines
404 B
Perl
12 lines
404 B
Perl
#! /usr/bin/perl
|
|
|
|
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*class.*)\n\s*{\s*$/$1 {/img;
|
|
$source =~ s/^(\S*::\S*.*)\n\s*: /$1 : /img;
|
|
$source =~ s/(?:\G|^)[ ]{6}/\t/mg;
|
|
$source =~ s/(?:\G|^)(\t*)[ ]{4}"/$1\t"/mg;
|
|
open (DIFF, "| diff -u $input -");
|
|
print DIFF $source ;
|