core-validate-commit
Advanced tools
Comparing version 3.6.1 to 3.6.2
@@ -34,2 +34,8 @@ 'use strict' | ||
const line = parsed.body[i] | ||
// Skip quoted lines, e.g. for original commit messages of V8 backports. | ||
if (line.startsWith(' ')) | ||
continue | ||
// Skip lines with URLs. | ||
if (/https?:\/\//.test(line)) | ||
continue | ||
if (line.length > len) { | ||
@@ -36,0 +42,0 @@ failed = true |
{ | ||
"name": "core-validate-commit", | ||
"version": "3.6.1", | ||
"version": "3.6.2", | ||
"description": "Validate the commit message for a particular commit in node core", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -70,3 +70,67 @@ 'use strict' | ||
t.test('quoted lines', (tt) => { | ||
const v = new Validator() | ||
const context = new Commit({ | ||
sha: 'e7c077c610afa371430180fbd447bfef60ebc5ea' | ||
, author: { | ||
name: 'Evan Lucas' | ||
, email: 'evanlucas@me.com' | ||
, date: '2016-04-12T19:42:23Z' | ||
} | ||
, message: `src: make foo mor foo-ey | ||
Here’s the original code: | ||
${'aaa'.repeat(30)} | ||
That was the original code. | ||
` | ||
}, v) | ||
context.report = (opts) => { | ||
tt.pass('called report') | ||
tt.equal(opts.id, 'line-length', 'id') | ||
tt.equal(opts.string, '', 'string') | ||
tt.equal(opts.level, 'pass', 'level') | ||
} | ||
Rule.validate(context, { | ||
options: { | ||
length: 72 | ||
} | ||
}) | ||
tt.end() | ||
}) | ||
t.test('URLs', (tt) => { | ||
const v = new Validator() | ||
const context = new Commit({ | ||
sha: 'e7c077c610afa371430180fbd447bfef60ebc5ea' | ||
, author: { | ||
name: 'Evan Lucas' | ||
, email: 'evanlucas@me.com' | ||
, date: '2016-04-12T19:42:23Z' | ||
} | ||
, message: `src: make foo mor foo-ey | ||
https://${'very-'.repeat(80)}-long-url.org/ | ||
` | ||
}, v) | ||
context.report = (opts) => { | ||
tt.pass('called report') | ||
tt.equal(opts.id, 'line-length', 'id') | ||
tt.equal(opts.string, '', 'string') | ||
tt.equal(opts.level, 'pass', 'level') | ||
} | ||
Rule.validate(context, { | ||
options: { | ||
length: 72 | ||
} | ||
}) | ||
tt.end() | ||
}) | ||
t.end() | ||
}) |
@@ -208,7 +208,7 @@ 'use strict' | ||
}) | ||
tt.equal(filtered.length, 3, 'messages.length') | ||
tt.equal(filtered.length, 2, 'messages.length') | ||
const ids = filtered.map((item) => { | ||
return item.id | ||
}) | ||
const exp = ['line-length', 'line-length', 'title-length'] | ||
const exp = ['line-length', 'title-length'] | ||
tt.deepEqual(ids.sort(), exp.sort(), 'message ids') | ||
@@ -215,0 +215,0 @@ tt.end() |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54198
1751