gate: lint every shell script with shellcheck, and fail when shellcheck is missing #761

Open
opened 2026-10-14 19:11:59 +00:00 by hexajon · 0 comments
Owner

What

The gate runs shellcheck on one file, scripts/install.sh (scripts/check-install-sh-pins.sh:84-85). The repo tracks 52 .sh files. The other 51 get no lint, and 9 of them are the plugin hooks in hooks/scripts/ that ship to users.

The one lint that runs is skipped when shellcheck is not installed. scripts/check-install-sh-pins.sh:86-87 prints a skip line, and the step still passes. The CI gate job installs only jq and python3 (.forgejo/workflows/ci.yml:151), so CI does not install shellcheck for this step.

How

  • Add a gate step that runs shellcheck on every git-visible .sh file and fails on any finding.
  • Make the step fail when shellcheck is missing. Remove the skip at scripts/check-install-sh-pins.sh:86-87.
  • Install a pinned shellcheck in the CI gate job and in scripts/setup-dev.sh, at the same version.

Acceptance

  • The gate fails when any tracked .sh file has a shellcheck finding.
  • The gate fails, and names the cause, when shellcheck is not installed.
  • CI runs the step with the pinned version.
## What The gate runs shellcheck on one file, `scripts/install.sh` (`scripts/check-install-sh-pins.sh:84-85`). The repo tracks 52 `.sh` files. The other 51 get no lint, and 9 of them are the plugin hooks in `hooks/scripts/` that ship to users. The one lint that runs is skipped when shellcheck is not installed. `scripts/check-install-sh-pins.sh:86-87` prints a skip line, and the step still passes. The CI `gate` job installs only `jq` and `python3` (`.forgejo/workflows/ci.yml:151`), so CI does not install shellcheck for this step. ## How - Add a gate step that runs shellcheck on every git-visible `.sh` file and fails on any finding. - Make the step fail when shellcheck is missing. Remove the skip at `scripts/check-install-sh-pins.sh:86-87`. - Install a pinned shellcheck in the CI `gate` job and in `scripts/setup-dev.sh`, at the same version. ## Acceptance - The gate fails when any tracked `.sh` file has a shellcheck finding. - The gate fails, and names the cause, when shellcheck is not installed. - CI runs the step with the pinned version.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
sixfold-space/madtea#761
No description provided.