ci: add lint workflow with prettier and cspell checks#114
Conversation
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.
5bc4227 to
6314df1
Compare
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the lint workflow addition ( Code Review DetailsNo new findings. All prior review feedback has been addressed and both prior threads are resolved. |
There was a problem hiding this comment.
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
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.
theMickster
left a comment
There was a problem hiding this comment.
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?
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.
🎟️ 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 rannpm install.📔 Objective
Add a
LintGitHub 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.jsondictionary.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
npm run lint:prettierprettierdefaults +.prettierignorenpm run lint:spelling.cspell.jsonnpm run lintruns both.npm run formatwrites prettier fixes locally.Bundled changes
.github/workflows/lint.yml— runs on PRs, pushes tomain, andworkflow_dispatch.node-version: 24(current LTS; no prior precedent in the repo)..prettierignore— excludes lockfiles,node_modules,build/dist, coverage.package.json— addscspell@9.8.0(pinned to match other devDeps) andlint,lint:prettier,lint:spelling,formatscripts..cspell.json— adds 44 legitimate domain/dev/API-field words (customfield,issuetype,webui,modelcontextprotocol,WCAG,PKCE,bwwl,vnext,Newtonsoft, etc.); ignoresbuild/dist/coveragepaths.bitwarden-atlassian-toolsMCP server source andbitwarden-code-review/README.md.cspell:ignorecomments 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.