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.0 to 0.1.1

7

lib/commit-message-validator.js

@@ -8,3 +8,3 @@ 'use strict'

const DEFAULT_PATTERN = '.+'
const DEFAULT_ERROR_MESSAGE = 'Commit message does not match pattern'
const MERGE_REGEX = /^Merge\s+.+/i

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

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

@@ -27,2 +26,6 @@ } catch (error) {

try {
if (MERGE_REGEX.test(message)) {
process.exit(0)
}
const options = getOptions()

@@ -29,0 +32,0 @@ const regex = new RegExp(options.pattern)

{
"name": "commit-message-validator",
"version": "0.1.0",
"version": "0.1.1",
"description": "Git commit-msg hook validator",

@@ -5,0 +5,0 @@ "main": "index.js",

# commit-message-validator
Git commit-msg hook validator
This package provides you a binary that you can use as a git hook to validate the commit message.
If you are using githook package such as [husky](https://www.npmjs.com/package/husky), add `"commitmsg": "commit-message-validator"` to your npm scripts in package.json.
# Installation
This module is distributed via npm which is bundled with node and should be installed as one of your project's devDependencies:
npm install commit-message-validator
# Usage
1. Install this package as one of your project's devDependencies
2. Install githook [husky](https://www.npmjs.com/package/husky)
3. Custom commit-message regex pattern in package.json
{
"config": {
"commit-message-validator": {
/* your config here */
"pattern": "your regex pattern here"
}
}
}
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