ci: lint scripts, Dockerfile and workflows with make lint #42

Merged
piscis merged 1 commit from piscis/make-lint into main 2026-10-10 07:49:00 +00:00
Owner

CI built and smoke-tested the Image, but it never linted anything. This PR adds make lint and runs it as the first CI step after the tools are installed.

  • shellcheck on scripts/*.sh, hadolint on the Dockerfile, actionlint on .forgejo/workflows/*.yml (which also shellchecks the run: blocks). Each linter runs in a container image pinned by digest.
  • Each file goes to its linter on stdin. CI's docker daemon is the shared dind (#3), so a bind mount of the checkout would come up empty.
  • Findings that existed before this PR, now fixed:
    • ci.yml cleanup step: the unquoted docker image rm $images (SC2086) is now xargs.
    • Dockerfile: DL3018 (unpinned apk add git) is ignored, with the reason as a comment. The base image is pinned by digest.
    • actionlint: the docker runner label is accepted.
  • The README now lists make lint and the lint step in CI.

Checked locally: make lint passes on this branch and fails on a script containing an unquoted rm -rf $1/x.

CI built and smoke-tested the Image, but it never linted anything. This PR adds `make lint` and runs it as the first CI step after the tools are installed. - shellcheck on `scripts/*.sh`, hadolint on the `Dockerfile`, actionlint on `.forgejo/workflows/*.yml` (which also shellchecks the `run:` blocks). Each linter runs in a container image pinned by digest. - Each file goes to its linter on stdin. CI's docker daemon is the shared dind (#3), so a bind mount of the checkout would come up empty. - Findings that existed before this PR, now fixed: - `ci.yml` cleanup step: the unquoted `docker image rm $images` (SC2086) is now `xargs`. - `Dockerfile`: DL3018 (unpinned `apk add git`) is ignored, with the reason as a comment. The base image is pinned by digest. - actionlint: the `docker` runner label is accepted. - The README now lists `make lint` and the lint step in CI. Checked locally: `make lint` passes on this branch and fails on a script containing an unquoted `rm -rf $1/x`.
ci: lint scripts, Dockerfile and workflows with make lint
All checks were successful
ci / build (pull_request) Successful in 46s
8d46d9aa56
piscis merged commit 6bdd135997 into main 2026-10-10 07:49:00 +00:00
piscis deleted branch piscis/make-lint 2026-10-10 07:49:00 +00:00
Sign in to join this conversation.
No description provided.