-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
detektFiles.pl
36 lines (29 loc) · 1013 Bytes
/
detektFiles.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/perl --
use 5.32.0;
use strict;
use warnings;
my $inFile = "app/build/reports/detekt/st-detektAll.txt";
my $rv = system qq(./gradlew :app:detektAll);
$rv == 256 and $rv =0;
$rv and die "gradle failed.";
say "#############################################";
say "# reading $inFile ...";
my @lines;
open(my $fh, "<:encoding(UTF-8)",$inFile) or die "$! $inFile";
while(<$fh>){
s/[\x0d\x0a]+//;
next if not length;
s|\\|/|g;
# SpacingAroundCurly - [<anonymous>] at Z:\mastodon-related\SubwayTooter\app\src\main\java\jp\juggler\subwaytooter\itemviewholder\ItemViewHolderShowStatus.kt:359:21 - Signature=ItemViewHolderShowStatus.kt${
if( m|\A(\S+) - \[([^]]+)\] at (\S+)|){
my($name,$obj,$pos)=($1,$2,$3);
$pos =~ s|\A.*?/SubwayTooter/||;
push @lines,"$pos $name [$obj]";
next;
}
die "parse error: ?? $_";
}
say "#############################################";
say "# result:";
@lines or say "no problems found.";
say $_ for sort @lines;