https://github.com/commitizen/cz-cli
Under the default configuration, Commitizen will pull its configuration from commitlint config files, as there is a high likelihood both tools will be used together. The below sample configuration will apply the @commitlint/config-conventional standard for both Commitizen and commitlint.
-
Create a
.czrc
Commitizen config file with the following contents:{"path": "@commitlint/cz-commitlint"}
-
If you don't already have a commitlint config, create one of the following:
-
JS config (
commitlint.config.js
){extends: ['@commitlint/config-conventional']}
-
YAML config: (
.commitlintrc.yaml
)extends: "@commitlint/config-conventional"
-
-
If you wish to install a git hook that will run Commitizen upon
git commit
:trunk actions enable commitizen
-
If you wish to have the
commitizen
andcz
CLIs available for your project:trunk tools enable commitizen
-
If you wish to enable
commitlint
to lint your commit contents:trunk actions enable commitlint
In order to use a different Commitizen adapter than the default @commitlint/cz-commitlint
, change
the contents of the path
value in .czrc
. After changing this, Commitizen will no longer use
commitlint config files.
You'll need to consult the documentation for your new adapter in order to configure further settings.
If you still want to use commitlint configs with Commitizen, but not
@commitlint/config-conventional
, simply change the value of extends
in your commitlint config
file.