aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-04-23 16:52:07 -0400
committerB. Watson <urchlay@slackware.uk>2026-04-23 16:52:07 -0400
commitef26c51a96daff594690c18690131c653744652c (patch)
tree7e6bcbbeb50dc6c8a1fc839a3693b6be1c223638
parente099cf36d1d3d5457fcc003308da6e913be619e1 (diff)
downloadsbo-maintainer-tools-ef26c51a96daff594690c18690131c653744652c.tar.gz
Add check for files you maybe forgot to add to git, add tab and carriage return check for .info files.HEADmaster
-rw-r--r--TODO6
-rwxr-xr-xsbolint39
2 files changed, 44 insertions, 1 deletions
diff --git a/TODO b/TODO
index dbb4159..9cfc7fa 100644
--- a/TODO
+++ b/TODO
@@ -1,3 +1,9 @@
+Missing argument in printf at /home/urchlay/bin/sbolint line 544, <$fh> line 2.
+
+TODO: sbolint should check for invalid characters in REQUIRES. someone
+ had an issue with a tab character, which looked fine when editing
+ or viewing the file... but the submission form choked on it.
+TODO: sbopkglint: error on 0.0.0.dist-info
TODO: sbolint: maybe? complain about backticks
TODO: sbopkglint: maybe? change "forbidden" to:
--- etc/ld.so.conf not allowed to exist in SBo packages.
diff --git a/sbolint b/sbolint
index 85d675a..d3d4da8 100755
--- a/sbolint
+++ b/sbolint
@@ -759,6 +759,8 @@ sub run_checks {
# try to second-guess the user otherwise.
push @checks, \&check_junkfiles if $checking_tarball;
+ push @checks, \&not_in_git if $in_git_repo;
+
for(@checks) {
$_->($build);
}
@@ -1039,6 +1041,14 @@ sub check_info {
$fixable++;
}
+ if(/\t/) {
+ log_error("$file:$lineno: tab characters are not allowed");
+ }
+
+ if(/\r/) {
+ log_error("$file:$lineno: carriage returns (\\r) are not allowed");
+ }
+
if(my ($k, $s1, $s2, $q1, $val, $q2) = /^(\w+)(\s*)=(\s*)("?)(.*?)("?)$/) {
if(!grep { $k eq $_ } @expected) {
log_error("$file:$lineno: invalid key '$k'");
@@ -1196,7 +1206,7 @@ sub curl_head_request {
my $client_filename = $_[1];
$client_filename =~ s,.*/,,;
- my @curlcmd = qw/curl --max-time 20 --head --location --silent --fail/;
+ my @curlcmd = qw/curl --max-time 60 --head --location --silent --fail/;
push @curlcmd, $_[1];
open my $pipe, "-|", @curlcmd;
@@ -1877,6 +1887,33 @@ sub check_junkfiles {
# }
}
+# 20250114 bkw: if we're in a git repo and these files exist, but are
+# not checked in to git, that generally means someone forgot to 'git
+# add' them.
+sub not_in_git {
+ open my $gitpipe, "git status --porcelain=2 . |";
+ if(!$gitpipe) {
+ log_error("can't run 'git status' but we're in a git repo");
+ return;
+ }
+
+ while(<$gitpipe>) {
+ chomp;
+
+ my ($file) = (/^\?\s(.*)/);
+ next unless $file;
+
+ for($file) {
+ my $msg = "$file not in git repo, did you mean to add it?";
+ if(/^.*\.(?:diff|patch|sh|desktop)/) {
+ log_warning($msg);
+ } else {
+ log_note($msg);
+ }
+ }
+ }
+}
+
# if anything *.diff or *.patch contains \r, warn the
# user about git stripping the \r's (better gzip it).
# 20231223 bkw: this check relies on check_and_read special-casing