Skip to content

Commit 2a2de85

Browse files
authored
rules: don't check cases for deps: V8 commits (#62)
1 parent 6b866cd commit 2a2de85

File tree

2 files changed

+32
-11
lines changed

2 files changed

+32
-11
lines changed

lib/rules/title-format.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,20 @@ module.exports = {
5252
}
5353
}
5454

55-
const result = /^([^:]+?): [A-Z]/.exec(context.title)
56-
if (result) {
57-
context.report({
58-
id: id
59-
, message: 'First word after subsystem(s) in title should be lowercase.'
60-
, string: context.title
61-
, line: 0
62-
, column: result[1].length + 3
63-
, level: 'fail'
64-
})
65-
pass = false
55+
const isV8 = context.title.startsWith('deps: V8:')
56+
if (!isV8) {
57+
const result = /^([^:]+?): [A-Z]/.exec(context.title)
58+
if (result) {
59+
context.report({
60+
id: id
61+
, message: 'First word after subsystem(s) in title should be lowercase.'
62+
, string: context.title
63+
, line: 0
64+
, column: result[1].length + 3
65+
, level: 'fail'
66+
})
67+
pass = false
68+
}
6669
}
6770

6871
if (pass) {

test/rules/title-format.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,23 @@ test('rule: title-format', (t) => {
115115
tt.end()
116116
})
117117

118+
t.test('Skip case checks for V8 updates ', (tt) => {
119+
tt.plan(2)
120+
const context = makeCommit('deps: V8: cherry-pick e0a109c')
121+
122+
context.report = (opts) => {
123+
tt.pass('called report')
124+
tt.strictSame(opts, {
125+
id: 'title-format'
126+
, message: 'Title is formatted correctly.'
127+
, string: ''
128+
, level: 'pass'
129+
})
130+
}
131+
132+
Rule.validate(context)
133+
tt.end()
134+
})
135+
118136
t.end()
119137
})

0 commit comments

Comments
 (0)