Skip to content

Lint: typos, oxlint and ShellCheck in CI and the hook (sc-9611) - #261

Open
ndbroadbent wants to merge 8 commits into
ci-imagesfrom
ci-lint
Open

ndbroadbent wants to merge 8 commits into
ci-imagesfrom
ci-lint

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Fifth PR for sc-9611. It's stacked on #259.

New checks in CI's security job and the pre-commit hook (mise.toml pins them):

  • typos 1.53.0 (_typos.toml). The hook runs typos -w, which fixes what it's sure of and stages the result.
  • oxlint 1.96.0 (.oxlintrc.json, --deny-warnings).
  • ShellCheck 0.12.0 at warning level on every shell script, found by shebang (scripts/ci/shellcheck.sh). Until now only the orb's scripts and the workflows' run: blocks were checked.

It starts green:

  • typos: 51 findings, none of them real typos. _typos.toml allows each kind with its reason:
    • domain words: PNGs, Postgres BRIN, PDF FlateDecode and /DecodeParms, the test string café;
    • test inputs misspelled on purpose (thresold, APP_S3_REGOIN, MYAPP_DATABSE_POOL), which check that typos in settings get caught;
    • unparseable, which is valid English;
    • possessive identifiers (close_the_branchs_builds). Renaming those would touch app code other sessions are working in.
  • oxlint: 5 findings.
    • Two endsWith fixes in scripts/screenshots/lightbox.mjs (same behaviour).
    • no-control-regex is off for the gallery's model.ts: its URL checks reject control characters on purpose. Done in config, so the gallery files are untouched.
    • no-empty-file is off for Sprockets' required manifest.js.
  • ShellCheck: cp -R in place of cp -r (scripts/ci/visual.sh), and a here-string in place of | grep -q under pipefail (scripts/on-dev).

Hook: it now runs one tool at a time. rustfmt and typos -w both rewrite staged files, and two fixers on one file in parallel would lose an edit. The whole hook takes about 2 s.

Checked in a scratch clone: a staged .rs file with teh recieve and bad formatting was committed as the receive, formatted. A planted /x$/.test(s) made the commit fail on oxlint. Everything passes on the tree.


Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

… files, stage_fixed); the lint job's cargo fmt --check goes (sc-9611)

Nathan's decision (5 Dec 2026): formatters fix in a hook, CI has no format gate. mise.toml pins lefthook 2.2.4;
rustfmt.toml names the edition, since rustfmt on stdin doesn't read Cargo.toml. The hook formats each staged file
through stdin, so it never follows mod declarations into unstaged files. AGENTS.md: install the hooks once per clone,
never --no-verify. oxfmt for the frontend follows in its own PR, in a quiet window.
… pre-commit hook; every action pinned by SHA; release workflows hardened (sc-9611)

- pinact pinned every action (and pypi-publish's release/v1 branch) to a commit SHA, with the version in a comment.
- persist-credentials: false on every checkout: no job pushes with the checkout's token (deploy uses its own key).
- release.yml: contents: write only on the job that creates the release and moves v0; expressions reach run: scripts
  through env; no rust-cache for the binaries users download; workflow_run stays, with the reason it's safe.
- Gallery release workflows: setup-node sets no cache (zizmor ignore with the reason). The GitHub Action's
  GITHUB_PATH writes: ignore with the reason.
- shellcheck SC2337 (grep -q under pipefail) fixed in four package-content checks.
- .betterleaks.toml allows the made-up test database users and redaction examples; the tree scans clean.
…ree Rust workspaces and Trivy for every lockfile, failing on stale ignores (sc-9611)

Starts green: pin-project-lite 0.2.18 (yanked) updated; rsa's Marvin advisory ignored (dev-dependency only);
jsonwebtoken's CVE-2026-25537 ignored until 5 Jun 2027 (app/ only signs JWTs; the upgrade is its own story).
pnpm audit isn't used: it reads the gallery workspace's astro/ folder as the astro package and reports 19 false
advisories. Its own workflow, so a new advisory never holds back the CLI release (release.yml follows CI).
…toml fails on stale entries, Trivy ignores expire (sc-9611)
… images (app gates pull requests, renderer reports until sc-9674); the app image takes Debian's security updates; the live app image scanned daily (sc-9611)

The pinned debian:trixie-slim (Debian's newest) has fixable HIGH CVEs in openssl and zstd: the app's runtime stage now
runs apt-get upgrade, with today's date as a build arg so BuildKit's cache never keeps old packages. FROM lines keep
tags: CI pins them by digest through build-contexts (amd64-only digests would break local arm64 builds).
…(typos -w fixes and stages); the hook runs one tool at a time (sc-9611)

Starts green: two endsWith fixes (scripts/screenshots/lightbox.mjs), cp -R and a here-string in place of grep -q in
a pipe (visual.sh, on-dev). _typos.toml allows the domain words (PNGs, BRIN, FlateDecode, DecodeParms), the test
inputs misspelled on purpose and possessive identifiers. .oxlintrc.json turns off no-control-regex for the gallery's
URL checks (on purpose) and no-empty-file for Sprockets' manifest. scripts/ci/shellcheck.sh checks every shell
script, found by shebang.
…iberate misspellings only where they occur; hook lints .astro and shellchecks only staged scripts (review)

This branch has not been deployed

No deployments
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