Skip to content

Commit

Permalink
build: integrate commitlint (#46)
Browse files Browse the repository at this point in the history
Integrate commitlint into the repository pre-commit check so commit messages can trigger semantic-release properly

Co-authored-by: Simon Chen <[email protected]>
  • Loading branch information
schenedx and Simon Chen authored Sep 23, 2021
1 parent a4012e6 commit 6bfc7c2
Show file tree
Hide file tree
Showing 4 changed files with 913 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
run: npm run lint
- name: Test
run: npm run test
- name: commit-lint
run: git log -1 --pretty=format:"%s" | npx commitlint
- name: Build
run: npm run build
- name: i18n_extract
Expand Down
33 changes: 33 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const Configuration = {
/*
* Resolve and load @commitlint/config-conventional from node_modules.
* Referenced packages must be installed
*/
extends: ['@commitlint/config-conventional'],
/*
* Any rules defined here will override rules from @commitlint/config-conventional
*/
rules: {
'body-max-line-length': [2, 'always', Infinity],
'subject-case': [
2,
'never',
[],
],
},
/*
* Functions that return true if commitlint should ignore the given message.
*/
ignores: [(commit) => commit === ''],
/*
* Whether commitlint uses the default ignore rules.
*/
defaultIgnores: true,
/*
* Custom URL to show upon failure
*/
helpUrl:
'https://github.com/conventional-changelog/commitlint/#what-is-commitlint',
};

module.exports = Configuration;
Loading

0 comments on commit 6bfc7c2

Please sign in to comment.