Skip to content

Commit ac180de

Browse files
committed
fix(config): ignore @dependabot commits
@dependabot commits are formatted in a way that renders their trailers unparsable, and therefore useless. the `updated-dependencies` section in these commits makes it so that `git interpret-trailers --parse` yields an empty string. this fails the `trailer-exists` rule because `Signed-off-by` trailers are required Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent 135d3eb commit ac180de

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

src/config/__tests__/config.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ describe('unit:config/config', () => {
3333
})
3434

3535
describe('ignores', () => {
36-
it('should not set additional ignore rules', () => {
37-
expect(TEST_SUBJECT.ignores).to.be.an('array').of.length(0)
36+
it('should set additional ignore rules', () => {
37+
expect(TEST_SUBJECT.ignores).to.be.an('array').of.length(1)
3838
})
3939
})
4040

src/config/ignores.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@
99
*
1010
* @const {((commit: string) => boolean)[]} ignores
1111
*/
12-
const ignores: ((commit: string) => boolean)[] = []
12+
const ignores: ((commit: string) => boolean)[] = [
13+
/**
14+
* Ignores commits signed off by `dependabot[bot]`.
15+
*
16+
* Dependabot commits are formatted in a way that renders their trailers
17+
* unparsable, and therefore useless. The `'updated-dependencies'` section in
18+
* these commits makes it so that `git interpret-trailers --parse` yields an
19+
* empty string. This fails the `trailer-exists` rule because `Signed-off-by`
20+
* trailers are required.
21+
*
22+
* @param {string} commit - Raw commit to evaluate
23+
* @return {boolean} `true` if `commit` was signed off by `dependabot[bot]`
24+
*/
25+
(commit: string): boolean => /Signed-off-by: dependabot\[bot]/.test(commit)
26+
]
1327

1428
export default ignores

0 commit comments

Comments
 (0)