commitplease
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -5,4 +5,4 @@ var merge = require( "mout/object/merge" ), | ||
limits: { | ||
subject: 50, | ||
other: 72 | ||
subject: 72, | ||
other: 80 | ||
} | ||
@@ -35,2 +35,6 @@ }; | ||
if ( index > 1 && line.length > options.limits.other ) { | ||
// skip comments | ||
if ( /^#/.test( line ) ) { | ||
return; | ||
} | ||
errors.push( "Commit message line " + ( index + 1 ) + " too long: " + | ||
@@ -37,0 +41,0 @@ line.length + " characters, only " + options.limits.other + |
{ | ||
"name": "commitplease", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Validates strings as commit messages", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -23,5 +23,5 @@ # Commitplease | ||
var validate = require('commitplease/lib/validate'); | ||
var errors = commitplease(commit.message); | ||
var errors = validate(commit.message); | ||
if (errors.length) { | ||
postComment('This commit has ' errors.length + ' problems!'); | ||
postComment('This commit has ' + errors.length + ' problems!'); | ||
} | ||
@@ -28,0 +28,0 @@ ``` |
16
test.js
@@ -32,3 +32,9 @@ var validate = require( "./lib/validate" ); | ||
} | ||
} | ||
}, | ||
{ | ||
msg: "Component: short message\n" + | ||
"\n" + | ||
"# Long comment that has to be ignored line too long beyond 72 chars line too long beyond" + | ||
"line too long line too long line too long" | ||
}, | ||
]; | ||
@@ -38,4 +44,4 @@ | ||
{ | ||
msg: "Component: short message but actually over default limit", | ||
expected: [ "First line (subject) must be no longer than 50 characters" ] | ||
msg: "Component: short message but actually a little bit over default character limit", | ||
expected: [ "First line (subject) must be no longer than 72 characters" ] | ||
}, | ||
@@ -55,5 +61,5 @@ { | ||
{ | ||
msg: "component: bla\n\nline too long beyond 72 chars line too long beyond" + | ||
msg: "component: bla\n\nline too long beyond 80 chars line too long beyond" + | ||
"line too long line too long line too long", | ||
expected: [ "Commit message line 3 too long: 91 characters, only 72 allowed. Was: line too long beyond[...]" ] | ||
expected: [ "Commit message line 3 too long: 91 characters, only 80 allowed. Was: line too long beyond[...]" ] | ||
} | ||
@@ -60,0 +66,0 @@ ]; |
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
7817
192