aboutsummaryrefslogtreecommitdiff
path: root/sbolint
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2022-07-07 16:25:34 -0400
committerB. Watson <urchlay@slackware.uk>2022-07-07 16:25:34 -0400
commit3e7fe579412897e312c64a6e757d74148438a924 (patch)
tree4e5a22941e59b154bcb08517874e9c5cd0092df5 /sbolint
parent586ad2ce86475daeed7a09d00dc3e042dc9dde8b (diff)
downloadsbo-maintainer-tools-3e7fe579412897e312c64a6e757d74148438a924.tar.gz
sbolint: add note to try sbofixinfo in check_info()
Diffstat (limited to 'sbolint')
-rwxr-xr-xsbolint17
1 files changed, 17 insertions, 0 deletions
diff --git a/sbolint b/sbolint
index 6209f84..d40a561 100755
--- a/sbolint
+++ b/sbolint
@@ -844,6 +844,8 @@ sub check_info {
my @keys;
my $continuation = 0;
+ my $fixable = 0;
+
# parse and bitch about bad syntax...
for(@lines) {
$file_lineno++;
@@ -863,20 +865,24 @@ sub check_info {
if(/^\s*$/) {
log_error("$file:$lineno: blank line (get rid of it)");
+ $fixable++;
next;
}
unless(/=/) {
log_error("$file:$lineno: malformed line (no = sign, missing \\ on prev line?)");
+ $fixable++;
next;
}
if(s/^\s+//) {
log_error("$file:$lineno: leading whitespace before key");
+ $fixable++;
}
if(s/\s+$//) {
log_error("$file:$lineno: trailing whitespace at EOL");
+ $fixable++;
}
if(my ($k, $s1, $s2, $q1, $val, $q2) = /^(\w+)(\s*)=(\s*)("?)(.*?)("?)$/) {
@@ -885,37 +891,48 @@ sub check_info {
} else {
if($k ne $expected[$next_exp]) {
log_warning("$file:$lineno: out of order, expected $expected[$next_exp], got $k");
+ $fixable++;
}
$next_exp++;
}
if(not $q1) {
log_error("$file:$lineno: missing opening double-quote");
+ $fixable++;
}
if(not $q2) {
log_error("$file:$lineno: missing closing double-quote");
+ $fixable++;
}
if(length($s1) || length($s2)) {
log_error("$file:$lineno: no spaces allowed before/after = sign");
+ $fixable++;
}
my $oldval = $val;
if($val =~ s/^\s+//) {
log_error("$file:$lineno: leading space in value: \"$oldval\"");
+ $fixable++;
}
if($val =~ s/\s+$//) {
log_error("$file:$lineno: trailing space in value: \"$oldval\"");
+ $fixable++;
}
$info{$k} = $val;
} else {
log_error("$file:$lineno: malformed line");
+ $fixable++;
}
}
+ if($fixable) {
+ logmsg("NOTE", $fixable . " possibly-fixable errors found. suggest running sbofixinfo.");
+ }
+
# parsing done, now for semantic checks
my @missing;