Skip to content

ci: add Prettier and CSpell linting via git hooks and CI#201

Draft
withinfocus wants to merge 2 commits into
mainfrom
ci/add-lint-hooks-and-workflow
Draft

ci: add Prettier and CSpell linting via git hooks and CI#201
withinfocus wants to merge 2 commits into
mainfrom
ci/add-lint-hooks-and-workflow

Conversation

@withinfocus

Copy link
Copy Markdown
Contributor

🎟️ Tracking

No associated Jira ticket — repository tooling change.

📔 Objective

Wire up Prettier and CSpell linting for the template repo, enforced both locally (pre-commit git hook) and in CI on every pull request.

  • .githooks/pre-commit — runs Prettier (--check) on staged Markdown/JSON/JSON5/YAML and CSpell on staged Markdown. Invoked through the existing config-based [hook "linter"] in .gitconfig; enable per clone with git config set --local include.path "../.gitconfig".
  • .cspell.json — switched to "unknownWords": "report-common-typos" so only common typos (not every proper noun) are flagged, mirroring bitwarden/tech-breakdowns#17.
  • .github/workflows/lint.yml — new Lint workflow running the same Prettier + CSpell checks on every PR, on Node 24 (LTS), with SHA-pinned actions/checkout v7.0.0 and actions/setup-node v6.4.0. A comment notes it must mirror the git hook.
  • .github/renovate.json — added a custom.regex manager that keeps the pinned prettier@ / cspell@ versions in the hook and the workflow in sync, grouped as a single "lint tooling" PR.
  • README.md — documents the hook, the CI check, and how to enable hooks locally.

Tool versions are pinned and identical across the hook and workflow (prettier@3.9.1, cspell@10.0.1); Renovate bumps them together.

Wire up Prettier and CSpell linting for the template, enforced both
locally via the config-based pre-commit hook and in CI on every PR.

- .githooks/pre-commit: Prettier --check on staged Markdown/JSON/JSON5/
  YAML and CSpell on staged Markdown, invoked via [hook "linter"]
- .cspell.json: switch to "unknownWords": "report-common-typos"
- .github/workflows/lint.yml: new Lint workflow running the same checks
  on Node 24 with SHA-pinned actions
- .github/renovate.json: custom.regex manager keeps the prettier/cspell
  pins in the hook and workflow in sync, grouped as "lint tooling"
- README.md: document the hook, CI check, and local enablement
@withinfocus withinfocus added the ai-review Request a Claude code review label Jun 30, 2026
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the new Prettier + CSpell linting setup: the config-based pre-commit hook (.githooks/pre-commit) wired through .gitconfig, the mirrored CI Lint workflow (.github/workflows/lint.yml), the Renovate custom.regex manager that keeps the pinned prettier@3.9.1 / cspell@10.0.1 versions in sync across the hook and workflow, and the supporting .cspell.json and README.md changes. The hook and workflow use consistent tool versions, file globs, and flags, and the workflow follows good supply-chain hygiene (SHA-pinned actions, least-privilege contents: read, persist-credentials: false). The unquoted $staged_files word-splitting is intentional and documented. No security, correctness, or breaking-change concerns identified.

Code Review Details

No findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant