Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

commitplease

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commitplease - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

12

lib/validate.js
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 @@

5

package.json
{
"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 @@ ];

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc