If you include the slash symbol (/) in the scope of a commit message, subject-empty and type-empty rules start throwing errors.
For the commit message feat(components/Component): subject, I am currently getting the following output:
> commitlint -e
โง input: feat(components/Component): subject
โ message may not be empty [subject-empty]
โ type may not be empty [type-empty]
โ found 2 problems, 0 warnings
The commit message feat(components/Component): subject should pass.
Not sure.
Not sure.
feat(components/Component): subjectcommitlint -e
commitlint.config.js
module.exports = {
extends: ['@anvilabs/commitlint-config'],
};
Can't use scopes with slashes in them.
| Executable | Version |
| ---: | :--- |
| commitlint --version | 6.0.2 |
| git --version | 2.16.1 |
| node --version | 9.4.0 |
Probably a bug with conventional-commits-parser, will investigate.
Having the same issue with commas in scopes with recent releases. Works in v5.2.3, breaks in v5.2.4.
Fixed via 6.1.0. Let me know if you still run into problems!
ฮป commitlint -v
6.1.0
ฮป echo "feat(components/component): subject" | commitlint
โง input: feat(components/component): subject
โ found 0 problems, 0 warnings
ฮป echo "feat(components, component): subject" | commitlint
โง input: feat(components, component): subject
โ found 0 problems, 0 warnings
@marionebl It's happening again and it's different. Example repo is here.
Looks like there's an extra new-line before my commit message:
โ cra-rewired-starter git:(master) โ gc -m "feat(store/modules): add runtime"
husky > npm run -s precommit (node v8.11.1)
โ Running tasks for {src,config}/**/*.{js,jsx,json}
โ Running tasks for src/**/*.{css,less} [skipped]
โ No staged files match src/**/*.{css,less}
husky > npm run -s commitmsg (node v8.11.1)
โง input:
feat(store/modules): add runtime
โ message may not be empty [subject-empty]
โ type may not be empty [type-empty]
โ scope may not be empty [scope-empty]
โ found 3 problems, 0 warnings
without slash:
โ cra-rewired-starter git:(master) โ gc -m "feat(store-modules): add runtime"
husky > npm run -s precommit (node v8.11.1)
โ Running tasks for {src,config}/**/*.{js,jsx,json}
โ Running tasks for src/**/*.{css,less} [skipped]
โ No staged files match src/**/*.{css,less}
husky > npm run -s commitmsg (node v8.11.1)
โง input: feat(store-modules): add runtime
โ found 0 problems, 0 warnings
version:
โ cra-rewired-starter git:(master) โ node -v
v8.11.1
โ cra-rewired-starter git:(master) npm -v
6.0.0
โ cra-rewired-starter git:(master) โ grep 'version' node_modules/@commitlint/cli/package.json
"type": "version",
"version": "6.2.0",
cli-test:
โ cra-rewired-starter git:(master) โ echo "feat(components, component): subject" | ./node_modules/.bin/commitlint
โง input: feat(components, component): subject
โ found 0 problems, 0 warnings
โ cra-rewired-starter git:(master) โ echo "feat(components/component): subject" | ./node_modules/.bin/commitlint
โง input: feat(components/component): subject
โ found 0 problems, 0 warnings
@marionebl Did you see this? Do I need to submit a new issue?
Most helpful comment
@marionebl It's happening again and it's different. Example repo is here.
Looks like there's an extra new-line before my commit message:
without slash:
version:
cli-test: