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 2.2.2 to 2.2.3

.editorconfig

1

commit-msg-hook.js
#!/usr/bin/env node
// commitplease-original
require( "commitplease" )( process.argv[ 2 ] );

2

index.js

@@ -17,3 +17,3 @@ var fs = require( "fs" ),

console.error();
console.error( "Commit message was:");
console.error( "Commit message was:" );
console.error();

@@ -20,0 +20,0 @@ console.error( chalk.green( message ) );

@@ -11,3 +11,3 @@ var chalk = require( "chalk" ),

console.log( chalk.red( "Remove it and install this package again to install commitplease properly" ) );
process.exit(0);
process.exit( 0 );
}

@@ -14,0 +14,0 @@

var scissor = /# ------------------------ >8 ------------------------[\s\S]+/;
module.exports = function( value ) {
return value.replace( scissor, "" ).split( /\n/ ).filter(function( line ) {
return value.replace( scissor, "" ).split( /\n/ ).filter( function( line ) {
return !/^#/.test( line );
}).join( "\n").trim();
} ).join( "\n" ).trim();
};
var merge = require( "mout/object/merge" ),
semver = require( "semver"),
semver = require( "semver" ),
subjectExceptions = /^(fixup|squash)!|^\[[^\]]+\]:/,

@@ -19,4 +19,5 @@ defaults = {

// Can't cancel forEach, so abuse every to stop at first comment
message.split( /\n/ ).every(function( line, index ) {
message.split( /\n/ ).every( function( line, index ) {
if ( index === 0 ) {
// Allow tag commits

@@ -26,2 +27,3 @@ if ( semver.valid( line ) ) {

}
// Allow merge commits

@@ -63,2 +65,3 @@ if ( /^Merge branch/.test( line ) || /^Merge [0-9a-f]+ into [0-9a-f]+/.test( line ) ) {

}
// Ticket references

@@ -73,5 +76,5 @@ if ( index > 0 && /^(clos|fix|resolv)(e[sd]|ing)/i.test( line ) ) {

return true;
});
} );
return errors;
};
{
"name": "commitplease",
"version": "2.2.2",
"version": "2.2.3",
"description": "Validates strings as commit messages",

@@ -26,11 +26,11 @@ "main": "index.js",

"devDependencies": {
"nodeunit": "0.8.2",
"jshint": "2.5.6",
"jscs": "1.7.3"
"nodeunit": "^0.9.1",
"jshint": "^2.8.0",
"jscs": "^1.13.1"
},
"dependencies": {
"chalk": "0.4.0",
"mout": "0.8.0",
"semver": "2.2.1"
"chalk": "^1.1.0",
"mout": "^0.11.0",
"semver": "^5.0.1"
}
}

@@ -1,33 +0,33 @@

(function avoidSelfInstall() {
var pkg = require("./package"),
nameRegex = new RegExp("node_modules/" + pkg.name + "$");
if (!nameRegex.test(process.cwd().replace(/\\/g, "/"))) {
console.log("running install inside self, no need");
process.exit(0);
( function avoidSelfInstall() {
var pkg = require( "./package" ),
nameRegex = new RegExp( "node_modules/" + pkg.name + "$" );
if ( !nameRegex.test( process.cwd().replace( /\\/g, "/" ) ) ) {
console.log( "running install inside self, no need" );
process.exit( 0 );
}
}());
}() );
var path = require("path");
var fs = require("fs");
var root = path.resolve(__dirname, "../..");
var git = path.resolve(root, ".git");
var hooks = path.resolve(git, "hooks");
var path = require( "path" );
var fs = require( "fs" );
var root = path.resolve( __dirname, "../.." );
var git = path.resolve( root, ".git" );
var hooks = path.resolve( git, "hooks" );
var rootPackage = require(path.resolve(root, "package"));
if (rootPackage.commitplease && rootPackage.commitplease.nohook) {
console.error("package.json indicates to skip hook");
process.exit(0);
var rootPackage = require( path.resolve( root, "package" ) );
if ( rootPackage.commitplease && rootPackage.commitplease.nohook ) {
console.error( "package.json indicates to skip hook" );
process.exit( 0 );
}
// Check if we are in a git repository so we can bail out early when this is not the case.
if (!fs.existsSync(git) || !fs.lstatSync(git).isDirectory()) {
console.error("Could not find git repo in " + git);
process.exit(0);
if ( !fs.existsSync( git ) || !fs.lstatSync( git ).isDirectory() ) {
console.error( "Could not find git repo in " + git );
process.exit( 0 );
}
if (!fs.existsSync(hooks)) {
fs.mkdirSync(hooks);
if ( !fs.existsSync( hooks ) ) {
fs.mkdirSync( hooks );
}
var hook = path.resolve(hooks, "commit-msg");
var hook = path.resolve( hooks, "commit-msg" );
var hookFile = path.relative( path.resolve( hooks ), "./commit-msg-hook.js" );

@@ -41,4 +41,4 @@

fs.chmodSync( hook, "755" );
} catch (e) {
if (/EPERM/.test(e.message)) {
} catch ( e ) {
if ( /EPERM/.test( e.message ) ) {
console.error( "Failed to write commit-msg hook. " +

@@ -45,0 +45,0 @@ "Make sure you have the necessary permissions." );

@@ -187,6 +187,6 @@ var validate = require( "./lib/validate" ),

exports.valid = function( test ) {
valid.forEach(function(check, index) {
valid.forEach( function( check, index ) {
test.deepEqual( validate( sanitize( check.msg ), check.options ), [], "valid " + index +
" " + check.msg );
});
} );
test.done();

@@ -196,6 +196,6 @@ };

exports.invalid = function( test ) {
invalid.forEach(function(check, index) {
invalid.forEach( function( check, index ) {
test.deepEqual( validate( sanitize( check.msg ), check.options ), check.expected,
"invalid " + index + " " + check.msg );
});
} );
test.done();

@@ -202,0 +202,0 @@ };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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