Skip to content

Commit

Permalink
fix(commitlint): change header-max-length rule
Browse files Browse the repository at this point in the history
The rule between master and branch should be different to take the PR reference in consideration when merging
  • Loading branch information
chrisbottin committed Feb 8, 2021
1 parent 7ab86be commit 25e563f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions 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)"
}
}
8 changes: 7 additions & 1 deletion 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) "
}
}
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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"
}
},
Expand Down

0 comments on commit 25e563f

Please sign in to comment.