commitplease
Advanced tools
Comparing version 1.2.0 to 1.3.0
var merge = require( "mout/object/merge" ), | ||
semver = require( "semver"), | ||
defaults = { | ||
@@ -17,2 +18,6 @@ component: true, | ||
if ( index === 0 ) { | ||
// allow tag commits | ||
if ( semver.valid( line ) ) { | ||
return; | ||
} | ||
if ( line.length > options.limits.subject ) { | ||
@@ -43,2 +48,9 @@ errors.push( "First line (subject) must be no longer than " + | ||
} | ||
// ticket references | ||
if ( /^(close[sd]?|fix(e(sd)?)?|resolve[sd]?)/i.test( line ) ) { | ||
if ( !/(Fixes|Closes) (.*#|gh-)[0-9]+/.test( line )) { | ||
errors.push( "Invalid ticket reference, must be " + | ||
"/(Fixes|Closes) (#|gh-)[0-9]+/, was: " + line ); | ||
} | ||
} | ||
}); | ||
@@ -45,0 +57,0 @@ |
{ | ||
"name": "commitplease", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Validates strings as commit messages", | ||
@@ -29,5 +29,6 @@ "main": "index.js", | ||
"dependencies": { | ||
"colors": "0.6.2", | ||
"mout": "0.8.0", | ||
"colors": "0.6.2" | ||
"semver": "2.2.1" | ||
} | ||
} |
17
test.js
@@ -17,5 +17,10 @@ var validate = require( "./lib/validate" ); | ||
"\n" + | ||
"Close #xxx" | ||
"Closes #123" | ||
}, | ||
{ | ||
msg: "Component: short message\n" + | ||
"\n" + | ||
"Closes jquery/jquery-mobile#123" | ||
}, | ||
{ | ||
msg: "short message", | ||
@@ -40,2 +45,8 @@ options: { | ||
}, | ||
{ | ||
msg: "v1.13.0" | ||
}, | ||
{ | ||
msg: "0.0.1" | ||
} | ||
]; | ||
@@ -64,2 +75,6 @@ | ||
expected: [ "Commit message line 3 too long: 91 characters, only 80 allowed. Was: line too long beyond[...]" ] | ||
}, | ||
{ | ||
msg: "Docs: Fix a typo\n\nCloses: gh-155", | ||
expected: [ "Invalid ticket reference, must be /(Fixes|Closes) (#|gh-)[0-9]+/, was: Closes: gh-155" ] | ||
} | ||
@@ -66,0 +81,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
8504
219
3
+ Addedsemver@2.2.1
+ Addedsemver@2.2.1(transitive)