Zhengqbbb / cz-git

cz-git | czg 🛠️ DX first and more engineered, lightweight, customizable, standard output format Commitizen adapter and CLI
https://cz-git.qbb.sh
MIT License
1.05k stars 39 forks source link

[Feature Request] Allow to skip type #146

Closed cletter7 closed 11 months ago

cletter7 commented 11 months ago

💭 Describe the feature

In the monorepo I am working with we only need scope and not the type. We don't actually use the commit type for generating changelog, etc., but we still want to be able to see which package was impacted by some specific commit by its name. So currently we are using type as a scope and then use formatMessageCB to put the type in the place of scope. Something like:

formatMessageCB: ({ type, subject }) => `(${type}): ${subject}`

But in this case we are not able to choose multiple packages as you can only select one type. Ideally I'd like to skip type and be able to choose multiple options from the scope.

Could you make type skippable?

💡 Proposed Solution

Add possibility to specify type in the skipQuestions option so that the type question is skipped. Example:

skipQuestions: ['type']
Zhengqbbb commented 11 months ago

Actually it didn't configure's type support because cz-git follows the standard Conventional Commits specification.

But it can also work !!! : skipQuestions: ['type']

Below is my understanding of the configuration implementation. If you have other needs, welcome leave message

{
    skipQuestions: ['type', 'body', 'breaking', 'footerPrefix', 'footer'],
    enableMultipleScopes: true,
    formatMessageCB: ({ scope, subject }) => scope ? `(${scope}): ${subject}` : subject,
}

https://github.com/Zhengqbbb/cz-git/assets/40693636/b9d005bc-c357-4243-9cfc-468876f0d0fc

cletter7 commented 11 months ago

It works indeed. Just here the type of skipQuestions doesn't say that you can skip the type so I didn't even try it. Maybe worth updating the docs.

Thank you, closing the issue.