Skip to content

ci: download shfmt binary instead of installing via go - #2405

Merged
seefood merged 3 commits into
Bash-it:masterfrom
seefood:ci/drop-go-for-shfmt-binary/001-install-shfmt-binary
Aug 30, 2026
Merged

ci: download shfmt binary instead of installing via go#2405
seefood merged 3 commits into
Bash-it:masterfrom
seefood:ci/drop-go-for-shfmt-binary/001-install-shfmt-binary

Conversation

@seefood

@seefood seefood commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The lint job set up a Go toolchain (pinned to go-version: 1.25.8) solely to go install mvdan.cc/sh/v3/cmd/shfmt@latest, which builds shfmt from source on every run and is slow.
  • Replaced it with a direct download of the prebuilt Linux amd64 binary from the mvdan/sh releases, pinned to v3.14.0, mirroring the existing shellcheck install step in the same job.
  • Dropped the actions/setup-go step entirely since nothing else in the job needs Go.

Test plan

  • python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))" — YAML is well-formed
  • pre-commit hooks (including zizmor Actions security linter) pass on the changed file
  • CI run on this PR confirms the lint job still installs and runs shfmt successfully

The lint job pinned Go 1.25.8 solely to `go install` shfmt, which is
slow and pulls in the whole Go toolchain. Download the prebuilt Linux
binary from the mvdan/sh release instead, mirroring the shellcheck
install step already in this job.
- themes/modern-t: use -n instead of ! -z (SC2236)
- themes/powerturk: suppress SC2120 for _swd's unused optional
  path-override argument, matching the existing disable-comment
  convention already used in this file
Local shfmt was an apt-packaged 2022 build (Go 1.17.3) that predates
this formatting rule (space after ! inside arithmetic contexts), so
it never caught this. Verified against the same shfmt v3.14.0 the CI
lint job now installs.
@seefood
seefood merged commit 2a613f2 into Bash-it:master Aug 30, 2026
8 checks passed
@seefood
seefood deleted the ci/drop-go-for-shfmt-binary/001-install-shfmt-binary branch August 30, 2026 16:18
@seefood seefood mentioned this pull request Aug 30, 2026
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant