New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 0.5.7 to 1.0.0

11

lib/validate.js

@@ -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": {

@@ -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 @@ });

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