Skip to content

Commit 429ed78

Browse files
authored
Merge pull request #8 from projectpotos/fix-dependabot-lint
fix: dependabot commits being flaged
2 parents 4c8f6d5 + 383fa1d commit 429ed78

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

.github/configs/commitlint.config.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const { maxLineLength } = require('@commitlint/ensure')
2+
3+
const bodyMaxLineLength = 100
4+
5+
const validateBodyMaxLengthIgnoringDeps = (parsedCommit) => {
6+
const { type, scope, body } = parsedCommit
7+
const isDepsCommit =
8+
type === 'chore' && scope === 'release'
9+
10+
return [
11+
isDepsCommit || !body || maxLineLength(body, bodyMaxLineLength),
12+
`body's lines must not be longer than ${bodyMaxLineLength}`,
13+
]
14+
}
15+
16+
module.exports = {
17+
extends: ['@commitlint/config-conventional'],
18+
plugins: ['commitlint-plugin-function-rules'],
19+
rules: {
20+
'body-max-line-length': [0],
21+
'function-rules/body-max-line-length': [
22+
2,
23+
'always',
24+
validateBodyMaxLengthIgnoringDeps,
25+
],
26+
},
27+
}

.github/workflows/commit-lint.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ on:
77
pull_request:
88
workflow_call:
99

10-
jobs:
10+
jobs:
1111
commitlint:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v3
1515
with:
1616
fetch-depth: 0
1717
- uses: wagoid/commitlint-github-action@v5
18+
with:
19+
configFile: .github/configs/commitlint.config.js

0 commit comments

Comments
 (0)