Skip to content

ci: add lint workflow with prettier and cspell checks#114

Merged
withinfocus merged 3 commits into
mainfrom
add-lint-workflow
May 11, 2026
Merged

ci: add lint workflow with prettier and cspell checks#114
withinfocus merged 3 commits into
mainfrom
add-lint-workflow

Conversation

@withinfocus
Copy link
Copy Markdown
Contributor

@withinfocus withinfocus commented May 8, 2026

🎟️ Tracking

No Jira issue — noticed across several past PRs that contributors without husky installed were merging unformatted code, since lint-staged/husky only runs locally for those who ran npm install.

📔 Objective

Add a Lint GitHub Actions workflow that enforces in CI what the husky/lint-staged pre-commit hook gives us locally (prettier formatting), plus spell checking using the existing .cspell.json dictionary.

Modeled on bitwarden/clients lint.yml. One job, two sequential steps so that a prettier failure still surfaces cspell findings in the same run.

What's enforced

Check Command Source of truth
Prettier formatting npm run lint:prettier prettier defaults + .prettierignore
Spell check npm run lint:spelling .cspell.json

npm run lint runs both. npm run format writes prettier fixes locally.

Bundled changes

  • New .github/workflows/lint.yml — runs on PRs, pushes to main, and workflow_dispatch. node-version: 24 (current LTS; no prior precedent in the repo).
  • New .prettierignore — excludes lockfiles, node_modules, build/dist, coverage.
  • package.json — adds cspell@9.8.0 (pinned to match other devDeps) and lint, lint:prettier, lint:spelling, format scripts.
  • .cspell.json — adds 44 legitimate domain/dev/API-field words (customfield, issuetype, webui, modelcontextprotocol, WCAG, PKCE, bwwl, vnext, Newtonsoft, etc.); ignores build/dist/coverage paths.
  • Reformats 32 existing files to a clean baseline — what the pre-commit hook would have done. Touches bitwarden-atlassian-tools MCP server source and bitwarden-code-review/README.md.
  • Inline cspell:ignore comments for two deliberate test fixtures (Jira rank field, truncation test) instead of adding them to the dictionary.
  • CLAUDE.md — clarifies that formatting-only changes are exempt from plugin version bumps. Confirms why this PR doesn't need plugin version bumps despite touching plugin files.

Enforces what the husky/lint-staged pre-commit hook gives us locally,
plus spell checking using the existing .cspell.json dictionary. Noticed
several past PRs slipped in without prettier formatting because the
pre-commit hook only runs when contributors have husky installed.

- New Lint workflow (.github/workflows/lint.yml) running prettier and
  cspell on PRs, pushes to main, and workflow_dispatch.
- npm scripts: lint, lint:prettier, lint:spelling, format.
- .prettierignore for lockfiles, build/, dist/, coverage/.
- Reformats 32 existing files to a clean baseline (what the pre-commit
  hook would have done).
- Adds 44 legitimate domain/dev/API-field words to .cspell.json
  (customfield, issuetype, webui, modelcontextprotocol, WCAG, PKCE,
  bwwl, vnext, etc.); ignores build/dist/coverage paths.
- Inline cspell:ignore comments for two deliberate test fixtures (Jira
  rank field, truncation test) rather than polluting the dictionary.
- Clarifies in CLAUDE.md that formatting-only changes are exempt from
  plugin version bumps.
@withinfocus withinfocus force-pushed the add-lint-workflow branch from 5bc4227 to 6314df1 Compare May 8, 2026 19:33
@withinfocus withinfocus marked this pull request as ready for review May 8, 2026 19:35
@withinfocus withinfocus requested a review from a team as a code owner May 8, 2026 19:35
@withinfocus withinfocus added the ai-review Request a Claude code review label May 8, 2026
@withinfocus withinfocus closed this May 8, 2026
@withinfocus withinfocus reopened this May 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the lint workflow addition (.github/workflows/lint.yml), the supporting package.json, .prettierignore, .editorconfig, and .cspell.json configuration, the .claude/CLAUDE.md documentation updates, and the 32 prettier-reformatted files across bitwarden-atlassian-tools and bitwarden-code-review. The workflow correctly enforces prettier and cspell in CI, pins actions by SHA, applies minimal permissions, and disables credential persistence. Previously raised concerns about cspell being skipped on prettier failure and missing CLAUDE.md guidance for npm run lint were resolved in commits f331698 and 0ac2316.

Code Review Details

No new findings. All prior review feedback has been addressed and both prior threads are resolved.

Copy link
Copy Markdown
Contributor

@theMickster theMickster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the two findings that don't impact plugin tooling are simple enough to update that we should consider them.
I also find it interesting that the single pass didn't mention either but still hinted that it evaluated the CLAUDE.md file. My assumption is that the single-pass only looked at the diff as instructed and not holistically on how the changes impacted the workflow at the bottom of the file. 🤔

Please also note that I pulled down the feature branch and confirmed the following:
✅ All 258 tests are still passing
✅ The MCP server is still fully operational; the initialization and tools listing were successful

Comment thread .github/workflows/lint.yml
GitHub Actions skips subsequent steps after a non-zero exit by default,
so the original layout meant a prettier failure would skip the cspell
step entirely — contradicting the PR's stated goal of surfacing both
sets of findings in a single CI run.

Mark prettier with continue-on-error, run cspell with if: always(),
then add a final step that fails the job if either linter failed.
@withinfocus withinfocus requested a review from theMickster May 11, 2026 13:48
Copy link
Copy Markdown
Contributor

@theMickster theMickster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @withinfocus I don't know what happened. but this comment didn't make it into the first review. Will you please look at this too?

Comment thread .claude/CLAUDE.md
The new lint.yml CI workflow added a fifth CI gate (prettier + cspell)
but the "Validating Plugin Changes" section, which enumerates what
contributors should run locally before pushing, did not mention it.

Insert as the first validation step (fastest, applies to all changes,
not just plugin-specific files) and renumber the rest.
@withinfocus withinfocus requested a review from theMickster May 11, 2026 13:54
@withinfocus withinfocus merged commit a48c40a into main May 11, 2026
17 checks passed
@withinfocus withinfocus deleted the add-lint-workflow branch May 11, 2026 14:22
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.

2 participants