aboutsummaryrefslogtreecommitdiff
path: root/sbolint
diff options
context:
space:
mode:
Diffstat (limited to 'sbolint')
-rwxr-xr-xsbolint39
1 files changed, 38 insertions, 1 deletions
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