-
Notifications
You must be signed in to change notification settings - Fork 949
Closed
Labels
Description
Expected Behavior
our projects previous use scope like: feat(A/B): commit msg, B is a sub scope of A.
when we update @commitlint/cli from 8.3.5 to 19.2.1 , it doesn't work well as before, because for version 19.2.1 "/" is scopes delimiter to divide input scope string into several scopes.
Current Behavior
scopeEnum would divide input scope "A/B" to scope "A" and "B" to check if input scope in commitlint config rules scope-enum, we previous config scope "A/B" can not pass isScopeInEnum check.
Steps to reproduce
- nodejs project with @commitlint/cli 19.2.1 and husky 9.0.11
- set husky hooks
commit-msgnpx --no -- commitlint --edit $1 - project commitlint.config.js is
module.exports = {
extends: [...],
rules: {
"scope-empty": [2, "never"],
"scope-enum": [2, "always", ["workload/record"]]
}
}
- make some changes and commit code with message
test(workload/record): test commit, then get error message below:
% git commit -m "test(workload/record): test commit"
🔍 Finding changed files since git revision af2ddf4d.
🎯 Found 1 changed file.
✅ Everything is awesome!
⧗ input: test(workload/record): test commit
✖ scope must be one of [workload, workload/record,...]
✖ found 1 problems, 0 warnings
ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
husky - commit-msg script failed (code 1)
Affected packages
- cli
- core
- prompt
- config-angular
Possible Solution
set scopes delimiter as a optional config for user may solve this problem, if user do not config scopes delimiter, it will works well as before.