Skip to content

gam-script-checker-v0.4.5

Choose a tag to compare

@PaulOgier PaulOgier released this 03 Nov 15:03
· 137 commits to main since this release

GAM Script Checker v0.4.5

A pasted line that runs a shell script with a mode word, such as bash runbook.sh check, is now judged by the lines that mode runs. When the script reads its mode from the first argument (MODE="${1:-check}", or $1 itself) and picks a branch with a plain compare (if [ "$MODE" = "check" ], elif, else, or case "$MODE" in check)), the gam lines in the other branches are listed under NOT RUN IN THIS MODE and are not counted. A read-only mode of a script that also creates or deletes users now reads READ-ONLY. With no mode word, the default after :- is used.

If the mode is tested any other way, every line counts and a NOTE says why. That includes a pattern or a variable as the compared word, && in the test, a second assignment, shift, printf -v, read, nocasematch, a fallthrough (;&), a test inside a function, or a mode decided at runtime. A one-line guard (case "$MODE" in check|apply) ;; *) exit 1;; esac) counts its own line and does not block the reading.

A script checked on its own (gamcheck.py runbook.sh) still gets the whole-file verdict.

Tested on Linux (Python 3.14), macOS (Python 3.9 and 3.14) and Windows (Python 3.14).

SHA256

696cd88888ea8822492738b0df8ebb325c7cec5ef66f00a598192b6042c4c002  gam-script-checker-v0.4.5.zip
1f31b166324e0a03d3282ced4b6f3a6f7cdeb4ff99bd1dd6c45508ca73f76816  gamcheck.py
a1a66d32b34608c2c23fd8362abd6754e13a921b3a7b4011388b5c9c4e4f9647  verbs/gam7.json
c9eb70fb3c7f2aa08fb838679387ee19192f07e4d1af21cb52a06a1bb5b8a87a  verbs/gamadv-xtd3.json
a9251216bbe39581dd2723acdfa7652ee463c067128f95a549ba586e178988ec  verbs/legacy-gam.json
55178dbb0bf90bc85e0862568f1677b408d655eff0f880a605cdccbf75e9f46f  verbs/wiki.json