|
I'm trying to use cspell to spell check the commit message, as shown in the cspell docs: exec npx cspell --no-summary --no-progress --language-id commit-msg $1So I converted that to a commit-msg:
jobs:
- name: spellcheck
run: pnpm exec cspell --config .config/cspell.json --no-progress --no-summary --language-id commit-msg {1}That doesn't work: I'm also using cspell in a I think this has something to do with how lefthook passes the commit message to cspell via Is this a bug? Any suggestions? |
Replies: 2 comments 5 replies
|
The Lefthook docs say I would make two small changes while debugging: commit-msg:
jobs:
- name: spellcheck
run: pnpm exec cspell --config .config/cspell.json --no-progress --no-summary --language-id commit-msg "{1}"The quotes are mainly to protect odd paths. The bigger issue is that For one run, remove LEFTHOOK_OUTPUT="failure,execution,execution_out,execution_info" git commit -m "hello"You can also test the same command directly against the file Git passes: pnpm exec cspell --config .config/cspell.json --language-id commit-msg .git/COMMIT_EDITMSGSo I would not treat this as a Lefthook argument-passing bug yet. |
|
@lonix1 cSpell filters out the That is why I prefer to stream the commit-msg:
jobs:
- name: cSpell
run: |
npm exec --no -- cspell --language-id=commit-msg stdin < "{1}"
- name: commitlint
only:
- ref: main
run: |
npm exec --no -- commitlint --edit < "{1}"Now cSpell spell checks the commit message as the and ignores Hope this helps. |
Just for the context: I could make it work like this: