Skip to content

Commit

Permalink
ci: enforce conventional commits (#1684)
Browse files Browse the repository at this point in the history
  • Loading branch information
acud authored May 12, 2021
1 parent 8598ed2 commit 0b0bb9e
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
fetch-depth: 0
- name: Commit linting
if: matrix.os == 'ubuntu-latest'
uses: wagoid/commitlint-github-action@v2
- name: Cache Go modules
uses: actions/cache@v1
with:
Expand Down
40 changes: 40 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
module.exports = {
parserPreset: 'conventional-changelog-conventionalcommits',
rules: {
'body-leading-blank': [2, 'always'],
'body-max-line-length': [2, 'always', 72],
'body-case': [
2,
'never',
['sentence-case', 'start-case', 'pascal-case', 'upper-case'],
],
'footer-leading-blank': [1, 'always'],
'footer-max-line-length': [2, 'always', 72],
'header-max-length': [2, 'always', 72],
'subject-case': [
2,
'never',
['sentence-case', 'start-case', 'pascal-case', 'upper-case'],
],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
'type-enum': [
2,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'test',
],
],
},
};

0 comments on commit 0b0bb9e

Please sign in to comment.