Skip to content

Commit

Permalink
feat(config): add 'extends' configuration option
Browse files Browse the repository at this point in the history
Give users the option to extend Options with a deep merge with the object inside the "extends"
configuration option

fix commitizen#145
  • Loading branch information
oscard0m committed Feb 25, 2023
1 parent bfad899 commit a3be70c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var engine = require('./engine');
var conventionalCommitTypes = require('conventional-commit-types');
var configLoader = require('commitizen').configLoader;
var merge = require('lodash.merge');

var config = configLoader.load() || {};
var options = {
Expand All @@ -28,6 +29,10 @@ var options = {
100
};

if (!!config.extends) {
options = merge(options, config.extends);
}

(function(options) {
try {
var commitlintLoad = require('@commitlint/load');
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"commitizen": "^4.0.3",
"conventional-commit-types": "^3.0.0",
"lodash.map": "^4.5.1",
"lodash.merge": "^4.6.2",
"longest": "^2.0.1",
"word-wrap": "^1.0.3"
},
Expand Down

0 comments on commit a3be70c

Please sign in to comment.