Skip to content

Commit

Permalink
Add linting script and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-mitchell committed May 7, 2024
1 parent c4d6a38 commit 6c8997f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
4 changes: 4 additions & 0 deletions etc/gaplint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e

gaplint --disable W004 $@ *.g gap/* read.g init.g PackageInfo.g makedoc.g tst/testall.g tst/*.tst tst/examples/*.tst
12 changes: 0 additions & 12 deletions gap/splash.gi
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ if not IsBound(Splash) then
ErrorNoReturn("the 2nd argument must be a record,");
fi;


path := UserHomeExpand("~/");
if IsBound(opt.path) then
path := opt.path;
fi;


if IsBound(opt.directory) then
if not opt.directory in DirectoryContents(path) then
Exec(Concatenation("mkdir ", path, opt.directory));
Expand All @@ -47,13 +45,11 @@ if not IsBound(Splash) then
dir := Filename(tdir, "");
fi;


file := "vizpicture";
if IsBound(opt.filename) then
file := opt.filename;
fi;


if IsBound(opt.viewer) then
viewer := opt.viewer;
if not IsString(viewer) then
Expand All @@ -73,7 +69,6 @@ if not IsBound(Splash) then
fi;
fi;


if IsBound(opt.type) and (opt.type = "latex" or opt.type = "dot") then
type := opt.type;
elif Length(str) >= 6 and str{[1 .. 6]} = "%latex" then
Expand All @@ -90,14 +85,12 @@ if not IsBound(Splash) then
inn := Concatenation(dir, file, ".dot");
fi;


filetype := "pdf";
if IsBound(opt.filetype) and IsString(opt.filetype) and type <> "latex" then
filetype := opt.filetype;
fi;
out := Concatenation(dir, file, ".", filetype);


engine := "dot";
if IsBound(opt.engine) then
engine := opt.engine;
Expand All @@ -110,16 +103,11 @@ if not IsBound(Splash) then
fi;
fi;


FileString(inn, str);
if type = "latex" then


Exec(Concatenation("cd ", dir, ";",
"pdflatex ", file, " 2>/dev/null 1>/dev/null"));
else


Exec(Concatenation(engine, " -T", filetype, " ", inn, " -o ", out));
fi;
Exec(Concatenation(viewer, " ", out, " 2>/dev/null 1>/dev/null &"));
Expand Down

0 comments on commit 6c8997f

Please sign in to comment.