diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f2d9517..d133d22e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,8 @@ name: CI - -on: - pull_request: - push: - +"on": + pull_request: null + push: null jobs: - build: runs-on: ${{ matrix.os }} strategy: @@ -16,25 +13,23 @@ jobs: - 14 - 16 - 17 - os: [ubuntu-latest, macos-latest, windows-latest] - + os: + - ubuntu-latest + - macos-latest + - windows-latest steps: - name: 🛑 Cancel Previous Runs uses: styfle/cancel-workflow-action@0.9.1 with: access_token: ${{ secrets.GITHUB_TOKEN }} - - name: ⬇️ Checkout - uses: actions/checkout@v2 - + uses: actions/checkout@v3 - name: ⎔ Setup node ${{ matrix.node }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} cache: npm - - name: 📥 Download deps run: npm ci - - name: Test run: npm test diff --git a/index.js b/index.js index 7a4586d2..3c5307d2 100644 --- a/index.js +++ b/index.js @@ -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 = { @@ -28,6 +29,13 @@ var options = { 100 }; +if (!!config.extends) { + options = merge( + options, + typeof config.extends == 'string' ? require(config.extends) : config.extends + ); +} + (function(options) { try { var commitlintLoad = require('@commitlint/load'); diff --git a/package-lock.json b/package-lock.json index 8a9bc283..47573b0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,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" }, @@ -2837,6 +2838,11 @@ "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=" }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, "node_modules/lodash.uniqby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz", @@ -9976,6 +9982,11 @@ "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=" }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, "lodash.uniqby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz", diff --git a/package.json b/package.json index 856b0624..386bfc62 100644 --- a/package.json +++ b/package.json @@ -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" },