Repository navigation
Shell lint runs on every check-in, through star #672
Description
Chore. Plan: shell-lint-via-star.md (drafted, not yet committed).
Goal: shell checks run on every commit, through star, with no path that reports green without checking. .github/scripts/shell-lint.sh retires once nothing depends on it.
Three defects found while sizing the swap
Two of them make a check report success while doing nothing.
star hook pre-commitis dead. It fails immediately:lint.go: unexpected keyword argument "path" (did you mean paths?).hook-pre-commit.star:52passespath=where the parameter ispaths=;:81passespath=tolint.shellwhere it isfiles=. The Go check dies first, so the shell check never runs. Very likely why.githooks/pre-commitis hand-written bash and why pre-commit hooks were written off as buggy.lint.Shellreports success on an empty file list —if len(files) == 0 { return ShellResult{Passed: true} }. A discovery gap surfaces as a pass.star lint shelldiscovers by extension only —*.sh,*.bash,*.zsh. With (2), a tree of extensionless scripts lints clean having checked nothing, and this project's convention is extensionless scripts.
The capability is not missing. cmd/star/provider/shellcheck/provider.go's isShellFile already matches the extensions or a #!/…/{bash,sh,zsh} / env {bash,sh,zsh} shebang or a # shellcheck shell= directive — a strict superset of shell-lint.sh, plus vendor and node_modules pruning the script lacks. It simply belongs to a different entry point than the one the extension calls.
Steps
| # | Step | Done |
|---|---|---|
| 1 | hook-pre-commit.star:52 — lint.go(path=…) becomes paths= |
☐ |
| 2 | hook-pre-commit.star:81 — lint.shell(path=…) becomes files= |
☐ |
| 3 | lint.Shell stops returning Passed: true for an empty file set |
☐ |
| 4 | lint-shell.star — collect_files stops globbing; use the shebang/directive rule |
☐ |
| 5 | Discovery prunes .devlore, build, dist alongside .git, vendor, node_modules |
☐ |
| 6 | make shell-lint invokes $(STAR) lint shell ., depends on $(STAR) |
☐ |
| 7 | .githooks/pre-commit calls make shell-lint, not the script |
☐ |
| 8 | Delete .github/scripts/shell-lint.sh |
☐ |
| 9 | Pin it — a deliberately bad extensionless script must fail the lint | ☐ |
Order matters
Step 8 last, and only after 4. Deleting the script before discovery is fixed silently drops .githooks/pre-commit — a live, tracked, extensionless script that shell-lint.sh lints today and star lint shell does not — from every check.
Step 3 before 4. Fixing discovery while an empty set still reports green means a later regression goes quiet rather than red.
Related
- CI must be a strict superset of the local checks #670 — CI as a strict superset of local. This removes one of its three violations: the two competing shell-lint implementations.
Activity
build: the shell gate follows Declare-BashScript, and discovers throu…