Skip to content

Shell lint runs on every check-in, through star #672

Open

Description

@David-Noble-at-work

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.

  1. star hook pre-commit is dead. It fails immediately: lint.go: unexpected keyword argument "path" (did you mean paths?). hook-pre-commit.star:52 passes path= where the parameter is paths=; :81 passes path= to lint.shell where it is files=. The Go check dies first, so the shell check never runs. Very likely why .githooks/pre-commit is hand-written bash and why pre-commit hooks were written off as buggy.
  2. lint.Shell reports success on an empty file list — if len(files) == 0 { return ShellResult{Passed: true} }. A discovery gap surfaces as a pass.
  3. star lint shell discovers 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Epic:QualityCoverageCode quality, coverage, and the lint gateschoreMaintenance work on the repo: build, CI, tooling, process

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions