diff --git a/README.md b/README.md index ffc9691b..b59d9c90 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/index.js b/index.js index de9d3a30..d86155bc 100644 --- a/index.js +++ b/index.js @@ -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,