aboutsummaryrefslogtreecommitdiff
path: root/sbolint
diff options
context:
space:
mode:
Diffstat (limited to 'sbolint')
-rwxr-xr-xsbolint14
1 files changed, 13 insertions, 1 deletions
diff --git a/sbolint b/sbolint
index 0fb6e3d..0c70e61 100755
--- a/sbolint
+++ b/sbolint
@@ -142,6 +142,11 @@ For all builds:
=item -
+The SlackBuild, .info, README files must have Unix \n line endings (not
+DOS \r\n), and the last line of each must have a \n.
+
+=item -
+
The SlackBuild script must exist, with mode 0755 (or 0644, if in a git repo),
and be a I<#!/bin/sh> script.
@@ -612,11 +617,13 @@ sub check_and_read {
my $crlf_err;
my @lines;
+ my $lastline_nonl;
check_mode($file, $mode);
if(open my $fh, "<$file") {
while(<$fh>) {
+ $lastline_nonl = 1 unless /\n$/;
chomp;
$crlf_err = 1 if s/\r$//;
push @lines, $_;
@@ -627,11 +634,16 @@ sub check_and_read {
}
log_error("$file has DOS-style CRLF line endings") if $crlf_err;
+ log_error("$file has no newline at EOF") if $lastline_nonl;
return @lines;
}
sub check_readme {
- check_and_read("README", 0644);
+ my @lines = check_and_read("README", 0644);
+ if(grep { length > 72 } @lines) {
+ log_warning("README has lines >72 characters");
+ }
+ # TODO: check encoding (must be ASCII or UTF-8)
}
# the slack-desc checking code offends me (the author), on the one hand it's