Skip to content

Commit

Permalink
feat(types): add suport for custom types (commitizen#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury-tobias authored May 4, 2020
1 parent 2aae317 commit aae2548
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,33 @@ Like commitizen, you specify the configuration of cz-conventional-changelog thro
{
// ... default values
"config": {
"commitizen": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog",
"maxHeaderWidth": 100,
"maxLineWidth": 100,
"defaultType": "",
"defaultScope": "",
"defaultScope": "",
"defaultSubject": "",
"defaultBody": "",
"defaultIssues": ""
"defaultIssues": "",
"types": {
...
"feat": {
"description": "A new feature",
"title": "Features"
},
...
}
}
}
// ...
// ...
}
```
```
### Environment variables

The following environment varibles can be used to override any default configuration or package.json based configuration.

* CZ_TYPE = defaultType
* CZ_TYPE = defaultType
* CZ_SCOPE = defaultScope
* CZ_SUBJECT = defaultSubject
* CZ_BODY = defaultBody
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var configLoader = require('commitizen').configLoader;

var config = configLoader.load() || {};
var options = {
types: conventionalCommitTypes.types,
types: config.types || conventionalCommitTypes.types,
defaultType: process.env.CZ_TYPE || config.defaultType,
defaultScope: process.env.CZ_SCOPE || config.defaultScope,
defaultSubject: process.env.CZ_SUBJECT || config.defaultSubject,
Expand Down

0 comments on commit aae2548

Please sign in to comment.