Skip to content

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

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

ndbroadbent wants to merge 2 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.

…(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