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

commit-message-validator

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commit-message-validator - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

5

lib/commit-message-validator.js

@@ -6,5 +6,7 @@ 'use strict'

const path = require('path')
const chalk = require('chalk')
const DEFAULT_PATTERN = '.+'
const MERGE_REGEX = /^Merge\s+.+/i
const DEFAULT_ERROR_MESSAGE = 'Commit message cannot match pattern'

@@ -18,2 +20,3 @@ const getOptions = () => {

options.pattern = options.pattern || DEFAULT_PATTERN
options.errorMessage = options.errorMessage || DEFAULT_ERROR_MESSAGE

@@ -45,3 +48,3 @@ if (!Array.isArray(options.pattern)) {

}
console.warn('Commit message cannot match pattern')
console.warn(chalk.red(options.errorMessage))
process.exit(1)

@@ -48,0 +51,0 @@ }

6

package.json
{
"name": "commit-message-validator",
"version": "0.1.4",
"version": "0.1.5",
"description": "Git commit-msg hook validator",

@@ -35,2 +35,3 @@ "main": "index.js",

"dependencies": {
"chalk": "^1.1.3",
"find-git-root": "^0.1.0",

@@ -46,5 +47,6 @@ "find-root": "^1.0.0",

"^[vV]?\\d+\\.\\d+\\.\\d+"
]
],
"errorMessage": "Commit message must match pattern in package.json"
}
}
}

@@ -33,3 +33,4 @@ # commit-message-validator

/* your config here */
"pattern": "your regex pattern here"
"pattern": "your regex pattern here",
"errorMessage": "your error message"
}

@@ -50,3 +51,4 @@ }

"pattern N"
]
],
"errorMessage": "your error message"
}

@@ -53,0 +55,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