Adds two-tier linting before the existing docs/SCRIPTS.md regenerate step: - bash -n on every changed nomarchy-* script. Catches syntax errors that would otherwise be discovered at runtime by an unlucky user. Always fatal. - shellcheck --severity=error when shellcheck is on PATH. Catches unquoted-var, use-before-define, missing-shebang, and other bug-shaped patterns. Only error-level issues block - the long tail of pre-existing warnings stays as a known cleanup task, not a commit blocker. Hook silently skips this step when shellcheck isn't installed (so contributors without it can still commit). Catches the class of bug that's bit us repeatedly: a script ships, the runtime path that exercises the broken line is rare, and the bug sits latent until a user trips it. Cheaper to catch at commit time. Caveat: 156 nomarchy-* scripts already have shellcheck warnings (severity warning/info/style); we deliberately ship around them via the --severity=error gate. A future per-script audit can dial the severity up as scripts get cleaned up. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2.0 KiB
Executable File
2.0 KiB
Executable File