commitplease
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -17,2 +17,6 @@ var merge = require( "mout/object/merge" ), | ||
message.split(/\n/).forEach(function ( line, index ) { | ||
// skip comments | ||
if ( /^#/.test( line ) ) { | ||
return; | ||
} | ||
if ( index === 0 ) { | ||
@@ -40,6 +44,2 @@ // allow tag commits | ||
if ( index > 1 && line.length > options.limits.other ) { | ||
// skip comments | ||
if ( /^#/.test( line ) ) { | ||
return; | ||
} | ||
errors.push( "Commit message line " + ( index + 1 ) + " too long: " + | ||
@@ -53,3 +53,3 @@ line.length + " characters, only " + options.limits.other + | ||
errors.push( "Invalid ticket reference, must be " + | ||
"/(Fixes|Closes) (#|gh-)[0-9]+/, was: " + line ); | ||
"/(Fixes|Closes) (.*#|gh-)[0-9]+/, was: " + line ); | ||
} | ||
@@ -56,0 +56,0 @@ } |
{ | ||
"name": "commitplease", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Validates strings as commit messages", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,3 +5,3 @@ # Commitplease | ||
This [node.js](http://nodejs.org/) module validates git commit messages while you commit. | ||
This [node.js](http://nodejs.org/) module validates git commit messages while you commit, according to the rules specified in the [jQuery Commit Guidlines](http://contribute.jquery.org/commits-and-pull-requests/#commit-guidelines). These are pretty generic, so this module should be useful for most projects that care about commit message formats. | ||
@@ -41,9 +41,6 @@ ## Installation | ||
```js | ||
// component in subject is required | ||
component: true, | ||
limits: { | ||
// hard limit of subject | ||
subject: 50, | ||
// hard limit of all other lines | ||
other: 72 | ||
subject: 72, | ||
other: 80 | ||
} | ||
@@ -50,0 +47,0 @@ ``` |
@@ -49,2 +49,5 @@ var validate = require( "./lib/validate" ); | ||
msg: "0.0.1" | ||
}, | ||
{ | ||
msg: "Component: Message\n#comment" | ||
} | ||
@@ -77,3 +80,3 @@ ]; | ||
msg: "Docs: Fix a typo\n\nCloses: gh-155", | ||
expected: [ "Invalid ticket reference, must be /(Fixes|Closes) (#|gh-)[0-9]+/, was: Closes: gh-155" ] | ||
expected: [ "Invalid ticket reference, must be /(Fixes|Closes) (.*#|gh-)[0-9]+/, was: Closes: gh-155" ] | ||
} | ||
@@ -80,0 +83,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
8711
222
52