From 8d86b0d23ed3c67f083cbc472300c0362f594adf Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 30 May 2023 15:08:45 -0400 Subject: sbolint: summary for -a, notes for SLKCFLAGS and LIBDIRSUFFIX set but not used. --- sbolint | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'sbolint') diff --git a/sbolint b/sbolint index bf6e25e..b153a20 100755 --- a/sbolint +++ b/sbolint @@ -407,11 +407,16 @@ push @ARGV, "." unless @ARGV; $in_git_repo = system("git rev-parse >/dev/null 2>/dev/null") == 0; $argv_count = 0; +$err_warn_count = 0; for(@ARGV) { run_checks($_); $g_errcount += $errcount; $g_warncount += $warncount; + if($errcount || $warncount) { + $err_warn_count++; + } + if(!$quiet) { if($errcount == 0 and $warncount == 0) { print "$SELF: $buildname checks out " . $green . "OK" . $color_off . "\n"; @@ -428,11 +433,20 @@ for(@ARGV) { } if($progress_bar) { + my $t = scalar @ARGV; + my $ok = $t - $err_warn_count; + + printf STDERR "\n%d builds linted. %d (%.2f%%) OK, %d (%.2f%%) failed.\n", + $t, + $ok, 100 * (($ok) / $t), + $err_warn_count, 100 * ($err_warn_count / $t); + chomp (my $now = `date +%s`); my $elapsed = $now - $^T; my $min = int($elapsed / 60); my $sec = $elapsed % 60; - printf STDERR "\nElapsed time %d:%02d\n", $min, $sec; + + printf STDERR "Elapsed time %d:%02d\n", $min, $sec; } # print total errs/warns only if >1 build checked @@ -1433,12 +1447,15 @@ sub check_script { log_note("$file: it looks like this build includes both python2 and python3 code. consider splitting it into separate python2- and python3- builds."); } + # SLKCFLAGS and LIBDIRSUFFIX are notes, not errs/warns, because there are + # over 2000 existing builds from before this was added. anyway, unused + # variables don't really hurt anything. if($flags_set && (!$flags_used)) { - log_warning("$file:$flags_set: SLKCFLAGS gets set, but never used."); + log_note("$file:$flags_set: SLKCFLAGS gets set, but never used."); } if($libsuf_set && (!$libsuf_used)) { - log_warning("$file:$libsuf_set: LIBDIRSUFFIX gets set, but never used."); + log_note("$file:$libsuf_set: LIBDIRSUFFIX gets set, but never used."); } } -- cgit v1.2.3