mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-17 22:03:56 -07:00
Some have their editor configured to remove trailing whitespace and editing such a file would "fix" it, adding an unrelated change. Fix whitespace violations excluding third party libs and generated files like glad or patches. Enable pre-commit hook trailing-whitespace to enforce it in the future. Fixes: #8016 Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
22 lines
427 B
Perl
22 lines
427 B
Perl
use strict;
|
|
use warnings;
|
|
|
|
my @files = qw( .cpp .rc );
|
|
|
|
my @progs = (
|
|
{
|
|
PROJECT_NAME => "ActorEditor",
|
|
WINDOW_NAME => "ActorEditor",
|
|
},
|
|
);
|
|
|
|
for my $p (@progs) {
|
|
for my $f (@files) {
|
|
open IN, "<", "_template$f" or die "Error opening _template$f: $!";
|
|
open OUT, ">", "$p->{PROJECT_NAME}$f" or die "Error opening $p->{PROJECT_NAME}$f: $!";
|
|
while (<IN>) {
|
|
s/\$\$([A-Z_]+)\$\$/ $p->{$1} /eg;
|
|
print OUT;
|
|
}
|
|
}
|
|
}
|