aboutsummaryrefslogtreecommitdiff
path: root/sbolint
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2023-05-30 15:08:45 -0400
committerB. Watson <urchlay@slackware.uk>2023-05-30 15:08:45 -0400
commit8d86b0d23ed3c67f083cbc472300c0362f594adf (patch)
tree36a6129bce09c782663cb229e955a7f96d067d61 /sbolint
parente9ba15e5acce91405f8a743d74987d01c3cd8c53 (diff)
downloadsbo-maintainer-tools-8d86b0d23ed3c67f083cbc472300c0362f594adf.tar.gz
sbolint: summary for -a, notes for SLKCFLAGS and LIBDIRSUFFIX set but not used.
Diffstat (limited to 'sbolint')
-rwxr-xr-xsbolint23
1 files changed, 20 insertions, 3 deletions
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.");
}
}