commit-message-validator
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -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 @@ } |
{ | ||
"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 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7129
81
56
5
+ Addedchalk@^1.1.3
+ Addedansi-regex@2.1.1(transitive)
+ Addedansi-styles@2.2.1(transitive)
+ Addedchalk@1.1.3(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedhas-ansi@2.0.0(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedsupports-color@2.0.0(transitive)