commitplease
Advanced tools
Comparing version 0.5.7 to 1.0.0
@@ -23,11 +23,14 @@ var merge = require( "mout/object/merge" ), | ||
if ( options.component && line.indexOf( ":" ) < 1 ) { | ||
errors.push( "First line (subject) must indicate the component " + | ||
"(or subsystem)" ); | ||
errors.push( "First line (subject) must indicate the component" ); | ||
} | ||
if ( line.substring( line.indexOf( ":" ) + 1 ).length < 1 ) { | ||
errors.push( "First line (subject) must have a message after the component" ); | ||
} | ||
} | ||
if ( index === 1 && line.length > 0 ) { | ||
errors.push("Second line must always be empty"); | ||
errors.push( "Second line must always be empty" ); | ||
} | ||
if ( index > 1 && line.length > options.limits.other ) { | ||
errors.push( "Commit message line " + index + " too long: " + | ||
errors.push( "Commit message line " + ( index + 1 ) + " too long: " + | ||
line.length + " characters, only " + options.limits.other + | ||
@@ -34,0 +37,0 @@ " allowed. Was: " + line.substring( 0, 20 ) + "[...]" ); |
{ | ||
"name": "commitplease", | ||
"version": "0.5.7", | ||
"version": "1.0.0", | ||
"description": "Validates strings as commit messages", | ||
"main": "index.js", | ||
"scripts": { | ||
"install": "node install" | ||
"install": "node install", | ||
"test": "nodeunit test.js" | ||
}, | ||
@@ -9,0 +10,0 @@ "repository": { |
14
test.js
@@ -1,2 +0,2 @@ | ||
var commitplease = require( "./index" ); | ||
var validate = require( "./lib/validate" ); | ||
@@ -41,4 +41,8 @@ var valid = [ | ||
{ | ||
msg: "foo:", | ||
expected: [ "First line (subject) must have a message after the component" ] | ||
}, | ||
{ | ||
msg: "no component here", | ||
expected: [ "First line (subject) must indicate the component (or subsystem)" ] | ||
expected: [ "First line (subject) must indicate the component" ] | ||
}, | ||
@@ -52,3 +56,3 @@ { | ||
"line too long line too long line too long", | ||
expected: [ "Commit message line 2 too long: 91 characters, only 72 allowed. Was: line too long beyond[...]" ] | ||
expected: [ "Commit message line 3 too long: 91 characters, only 72 allowed. Was: line too long beyond[...]" ] | ||
} | ||
@@ -59,3 +63,3 @@ ]; | ||
valid.forEach(function(check, index) { | ||
test.deepEqual( commitplease( check.msg, check.options ), [], "valid " + index + | ||
test.deepEqual( validate( check.msg, check.options ), [], "valid " + index + | ||
" " + check.msg ); | ||
@@ -68,3 +72,3 @@ }); | ||
invalid.forEach(function(check, index) { | ||
test.deepEqual( commitplease( check.msg, check.options ), check.expected, | ||
test.deepEqual( validate( check.msg, check.options ), check.expected, | ||
"invalid " + index + " " + check.msg ); | ||
@@ -71,0 +75,0 @@ }); |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
6758
162
1