From 87cc5422751949bc858d135910b6c8f1079eaac5 Mon Sep 17 00:00:00 2001 From: MikeWallaceDev Date: Thu, 24 Feb 2022 20:22:02 -0500 Subject: [PATCH 1/2] refactor: change order of rules rules are now in order of a commit message and separated into sections. --- commitlint.config.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/commitlint.config.js b/commitlint.config.js index 91e40054f0..e6b276957c 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1,20 +1,24 @@ // module.exports = {extends: ['@commitlint/config-conventional']} module.exports = { rules: { - 'type-enum': [2, 'always', ['chore', 'ci', 'docs', 'feat', 'fix', 'refactor', 'style', 'test']], - 'body-leading-blank': [1, 'always'], - 'body-max-line-length': [2, 'always', 100], - 'footer-leading-blank': [1, 'always'], - 'footer-max-line-length': [2, 'always', 100], 'header-max-length': [2, 'always', 100], + + 'type-enum': [2, 'always', ['chore', 'ci', 'docs', 'feat', 'fix', 'refactor', 'style', 'test']], + 'type-empty': [2, 'never'], + 'type-case': [2, 'always', 'lower-case'], + 'subject-case': [ 2, 'never', ['sentence-case', 'start-case', 'pascal-case', 'upper-case'], ], 'subject-empty': [2, 'never'], - 'type-empty': [2, 'never'], - 'type-case': [2, 'always', 'lower-case'], - 'body-case': [2, 'never', []] + + 'body-leading-blank': [1, 'always'], + 'body-max-line-length': [2, 'always', 100], + 'body-case': [2, 'never', []], + + 'footer-leading-blank': [1, 'always'], + 'footer-max-line-length': [2, 'always', 100] }, }; From be3141b08e08918b046aef3255d8e2cef751621b Mon Sep 17 00:00:00 2001 From: MikeWallaceDev Date: Thu, 24 Feb 2022 20:36:18 -0500 Subject: [PATCH 2/2] ci: improve commitlint configuration Added types: build, feature no longer checks subject's case now forces a leading blank before body (This is required by Github) Increased body length to 200 --- commitlint.config.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/commitlint.config.js b/commitlint.config.js index e6b276957c..c59a378e48 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -3,20 +3,20 @@ module.exports = { rules: { 'header-max-length': [2, 'always', 100], - 'type-enum': [2, 'always', ['chore', 'ci', 'docs', 'feat', 'fix', 'refactor', 'style', 'test']], + 'type-enum': [2, 'always', ['build', 'chore', 'ci', 'docs', 'feat', 'feature', 'fix', 'refactor', 'style', 'test']], 'type-empty': [2, 'never'], 'type-case': [2, 'always', 'lower-case'], + 'subject-empty': [2, 'never'], 'subject-case': [ - 2, + 0, 'never', ['sentence-case', 'start-case', 'pascal-case', 'upper-case'], ], - 'subject-empty': [2, 'never'], - 'body-leading-blank': [1, 'always'], - 'body-max-line-length': [2, 'always', 100], - 'body-case': [2, 'never', []], + 'body-leading-blank': [2, 'always'], + 'body-max-line-length': [2, 'always', 200], + 'body-case': [0, 'never', []], 'footer-leading-blank': [1, 'always'], 'footer-max-line-length': [2, 'always', 100]