Scope: ability to select multiple scopes since the rule scope-enum allows multiple values.
See original GitHub issueWhen using the rule scope-enum, @commitlint/prompt and @commitlint/cz-commitlint render the question as a list from which only one answer can be selected. However, the rule scope-enum allows multiple values separated with a comma, back slash and/or forward slash
Expected Behavior
If the rule scope-enum is found in the config, the type of the question should be “checkbox” so multiple values can be selected.
Current Behavior
if the rule scope-enum is found in the config, the type of the question is “list” and only one value can be selected.
Affected packages
- cli
- core
- prompt
- config-angular
Possible Solution
From what I understand “inquirer” is used to render the question. So if the rule scope-enum is found in the config, the type of the question should be “checkbox”.
Steps to Reproduce (for bugs)
- Add scope-enum as a rule in the rules section of the commitlint config.
- Use @commitlint/prompt or @commitlint/cz-commitlint to render the question
Context
No being able to select multiple values for scope, forced me to duplicate the rule scope-enum and name it scope-choice so that the question is rendered as a question of type “text” instead of “list”.
Your Environment
Executable | Version |
---|---|
commitlint --version |
13.2.0 |
git --version |
2.31.0 |
node --version |
14.17.0 |
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Top GitHub Comments
@CJKay uhm, good point, wanna open up an issue for that? Maybe this should be a setting?
@escapedcat OK, I’ll focus on it tomorrow.