Skip to content

Commit

Permalink
feat: Add Commitlint
Browse files Browse the repository at this point in the history
  • Loading branch information
Korzun committed Sep 18, 2022
1 parent e000f62 commit 1b2b46a
Show file tree
Hide file tree
Showing 5 changed files with 1,904 additions and 42 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ jobs:
cache: 'npm'
- run: npm ci
- run: npm run lint:code
lint-git:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- run: npm ci
- run: npm run lint:git
lint-markdown:
runs-on: ubuntu-latest
steps:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ jobs:
cache: 'npm'
- run: npm ci
- run: npm run lint:code
lint-git:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- run: npm ci
- run: npm run lint:git
lint-markdown:
runs-on: ubuntu-latest
steps:
Expand Down
14 changes: 14 additions & 0 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { UserConfig } from '@commitlint/types';

export const Configuration: UserConfig = {
parserPreset: 'conventional-changelog-conventionalcommits',
rules: {
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
'type-enum': [2, 'always', ['chore', 'docs', 'feat', 'fix', 'revert']],
},
};

module.exports = Configuration;
Loading

0 comments on commit 1b2b46a

Please sign in to comment.