From 25e563fe88fd15e153ad4fe1bc14157df07bd741 Mon Sep 17 00:00:00 2001 From: Chris Bottin Date: Mon, 8 Feb 2021 09:45:34 +0000 Subject: [PATCH] fix(commitlint): change header-max-length rule The rule between master and branch should be different to take the PR reference in consideration when merging --- commitlint-branch.config.js | 6 ++++++ commitlint.config.js | 8 +++++++- package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 commitlint-branch.config.js diff --git a/commitlint-branch.config.js b/commitlint-branch.config.js new file mode 100644 index 000000000..56b9521f7 --- /dev/null +++ b/commitlint-branch.config.js @@ -0,0 +1,6 @@ +module.exports = { + extends: ['@commitlint/config-conventional'], + rules: { + 'header-max-length': [2, 'always', 64] // 72 (default) - 8 for PR reference e.g. " (#1234)" + } +} diff --git a/commitlint.config.js b/commitlint.config.js index 4fedde6da..53cb34d04 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1 +1,7 @@ -module.exports = { extends: ['@commitlint/config-conventional'] } +module.exports = { + extends: ['@commitlint/config-conventional'], + rules: { + // TODO(chrisbottin) Temporary change until master build is passing and commitlint-branch.config.js is committed + 'header-max-length': [2, 'always', 80] // 72 (default) + 8 for PR reference e.g. " (#1234) " + } +} diff --git a/package.json b/package.json index fc9e84e62..365f5fc74 100644 --- a/package.json +++ b/package.json @@ -489,7 +489,7 @@ "license": "MIT", "husky": { "hooks": { - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS -g commitlint-branch.config.js", "pre-commit": "npm run lint" } },