Skip to content

feat: Allow xb-cspell to check only staged files - #75

Merged
penyaskito merged 1 commit into
drupal-canvas:mainfrom
penyaskito:feat/cspell-staged
Aug 31, 2026
Merged

feat: Allow xb-cspell to check only staged files#75
penyaskito merged 1 commit into
drupal-canvas:mainfrom
penyaskito:feat/cspell-staged

Conversation

@penyaskito

Copy link
Copy Markdown
Contributor

Fixes #74.

Adds an optional staged argument to xb-cspell so it can lint only the files staged for commit — useful for pre-commit hooks.

Behavior

  • ddev xb-cspell — unchanged; lints the whole module via npm run lint:cspell.
  • ddev xb-cspell staged — runs cspell against git diff --cached files only (--diff-filter=ACMR, so deletions are excluded). Exits cleanly with a message when nothing is staged.
  • Any other argument prints an error and exits non-zero.

Also adds staged to AutocompleteTerms.

🤖 Generated with Claude Code



Adds an optional 'staged' argument to xb-cspell that runs cspell against
only the files staged for commit (git diff --cached), making it usable in
pre-commit hooks. With no argument the command still lints the whole module.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@penyaskito
penyaskito merged commit 2b7cd4b into drupal-canvas:main Aug 31, 2026
2 checks passed
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.

Allow xb-cspell to be checked only on staged files

1 participant