Closed jaklan closed 2 years ago
commitlint
provides support for multiple scopes: https://commitlint.js.org/#/concepts-commit-conventions?id=multiple-scopes
Yeah ! I checked their source code is done using inquirer/checkbox
And we are currently using inquirer-autocomplete-prompt
.It experience is very nice but currently does not support multiple selection
Then, you can select multiple scopes in
commitizen
withspace
and confirm withenter
. If empty scopes are forbidden, if no scope is selected you get the hint you need to select at least one to continue.
If he doesn't choose he can't go to the next question
π‘ Proposed Solution
To respect the above configuration. The one issue I see is the fact that in
cz-git
space
is used as input tosearch
, but imho in that case we can "override" its behaviour to select the scope instead - scopes with spaces are rather rare use-case, so imho such a compromise should be quite acceptable. Or we can just think about another keystroke to trigger scope selection / unselection (right arrow
to select,left arrow
to unselect?).
I think borrowing can be done with inquirer-checkbox-plus-prompt
, but then I have to write one myself. π€£
@Zhengqbbb https://github.com/faressoft/inquirer-checkbox-plus-prompt - such library actually already exists π (or maybe I just misunderstood your comment about "writing the one myself" π)
@Zhengqbbb https://github.com/faressoft/inquirer-checkbox-plus-prompt - such library actually already exists π (or maybe I just misunderstood your comment about "writing the one myself" π)
LOL, once my own personality starts, I will write all the inquirers myself π€―.
Hey bro ! @jaklan The latest version π(v1.2.9)π is support for multiple scopes . πͺ
Now yet I haven't added tests yet to make sure the checkboxes work, I need to add tests later π Please have a try. Let me know if there are still any issues. Thanks for reporting it! π
@jaklan Hi, The latest version π(v1.3.1)π You can enable multiple scopes mode without configuration Try it !
checkbox=1 cz
# same it can turn on emoji mode
emoji=1 cz
Hello @Zhengqbbb, sorry for a late response, I've finally found some time to test multiple scopes - and they work really nice, thank you!
Hello @Zhengqbbb, sorry for a late response, I've finally found some time to test multiple scopes - and they work really nice, thank you!
Great π€ Thx u response ~
π Describe the feature
commitlint
provides support for multiple scopes: https://commitlint.js.org/#/concepts-commit-conventions?id=multiple-scopesWhen you use
@commitlint/cz-commitlint
adapter, you can enable support for that incommitizen
as well by providing the following options incommitlint
config:https://commitlint.js.org/#/reference-prompt?id=settings
Then, you can select multiple scopes in
commitizen
withspace
and confirm withenter
. If empty scopes are forbidden, if no scope is selected you get the hint you need to select at least one to continue.π‘ Proposed Solution
To respect the above configuration. The one issue I see is the fact that in
cz-git
space
is used as input tosearch
, but imho in that case we can "override" its behaviour to select the scope instead - scopes with spaces are rather rare use-case, so imho such a compromise should be quite acceptable. Or we can just think about another keystroke to trigger scope selection / unselection (right arrow
to select,left arrow
to unselect?).