[kaffe] CVS kaffe (doogie): Print out the warning count per file.
Kaffe CVS
Kaffe Mailing List <kaffe@kaffe.org>
Sat Apr 3 21:14:02 2004
PatchSet 4619
Date: 2004/04/04 05:09:56
Author: doogie
Branch: HEAD
Tag: (none)
Log:
Print out the warning count per file.
Members:
ChangeLog:1.2196->1.2197
scripts/sort-warnings.pl:1.4->1.5
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2196 kaffe/ChangeLog:1.2197
--- kaffe/ChangeLog:1.2196 Sun Apr 4 05:02:55 2004
+++ kaffe/ChangeLog Sun Apr 4 05:09:56 2004
@@ -1,5 +1,9 @@
2004-04-03 Adam Heath <doogie@debian.org>
+ * scripts/sort-warnings.pl: Print out the warning count per file.
+
+2004-04-03 Adam Heath <doogie@debian.org>
+
* scripts/sort-warnings.pl:
* For each file, include the count of warnings.
* No longer print Param: when there are no params.
Index: kaffe/scripts/sort-warnings.pl
diff -u kaffe/scripts/sort-warnings.pl:1.4 kaffe/scripts/sort-warnings.pl:1.5
--- kaffe/scripts/sort-warnings.pl:1.4 Sun Apr 4 05:02:56 2004
+++ kaffe/scripts/sort-warnings.pl Sun Apr 4 05:09:58 2004
@@ -87,7 +87,7 @@
}
print( STDERR "done loading: " . length( $text ) . "\n" );
-my %allfiles;
+my %file_errors;
my %error_counts;
my %errors;
my $total_errors = 0;
@@ -109,7 +109,7 @@
$file =~ s,(?:(?:\.\./)+|/tmp/topic/)(include|kaffe|libraries|config)/,$1/,;
next if ( $file =~ m,^/, );
push( @{ $errors{ $type }{ $file }{ $line } }, [ grep( { defined( $_ ) } @matches ) ] );
- $allfiles{ $file } = 1;
+ $file_errors{ $file }++;
$error_counts{ $type }++;
$count++;
$total_errors++;
@@ -117,10 +117,15 @@
print( STDERR "$count\n" );
$text = $scanned . $text;
}
-#print( STDERR join( "\n", keys( %allfiles ) ) . "\n" );
+#print( STDERR join( "\n", keys( %file_errors ) ) . "\n" );
print( "\nTotal Errors: $total_errors\n\n" );
#print( Dumper( \%errors ) );
+foreach my $file ( sort( { $file_errors{ $b } <=> $file_errors{ $a } } keys( %file_errors ) ) ) {
+ my $count = $file_errors{ $file };
+ print( "File: $count\t$file\n" );
+}
+print( "\n" );
foreach my $type ( sort( { $error_counts{ $b } <=> $error_counts{ $a } } keys( %errors ) ) ) {
my $h1 = $errors{ $type };
print( "Type: $type\nCount: $error_counts{ $type }\n" );