This PR adds a msg-pattern-error property to the config object to allow custom error logs when the validation performed by msg-pattern fails.
Motivation:
Currently when validation for msg-pattern fails, only the pre-commit hook logs a message in the console ("pre-commit Nothing the hook needs to do. Bailing out.") since the checkMessageAgainstPattern method only calls the debug log function when validation fails.
We are shipping a new major release for our core components which includes pre-git and several tools for conventional releases, and I've have encountered several cases of devs not knowing about pre-git usage (even though all repos clearly state that it's being used and how the message pattern should be written) and since no clear error message is shown in the console, they just opted into using the --no-verify option.
I was torn between just changing the debug log method into just console.error and adding and additional option to the config, but I thought that maybe this was more helpful since it allows more customization (i.e.: we could direct devs to the documentation regarding our message pattern instead of logging the regex string)
Feature:
This PR adds a
msg-pattern-error
property to the config object to allow custom error logs when the validation performed bymsg-pattern
fails.Motivation:
Currently when validation for
msg-pattern
fails, only thepre-commit
hook logs a message in the console ("pre-commit Nothing the hook needs to do. Bailing out.") since thecheckMessageAgainstPattern
method only calls the debuglog
function when validation fails.We are shipping a new major release for our core components which includes
pre-git
and several tools for conventional releases, and I've have encountered several cases of devs not knowing aboutpre-git
usage (even though all repos clearly state that it's being used and how the message pattern should be written) and since no clear error message is shown in the console, they just opted into using the--no-verify
option.I was torn between just changing the debug
log
method into justconsole.error
and adding and additional option to the config, but I thought that maybe this was more helpful since it allows more customization (i.e.: we could direct devs to the documentation regarding our message pattern instead of logging the regex string)