lefthook
lefthook copied to clipboard
On-demand config validation
:zap: Summary
I'd like to see some on-demand validation when I invoke lefthook. Alternatively, it could insert an automatic pre-commit check when the configuration changes.
Value
After updating to 1.6, I first simply changed remote
to remotes
by intent. lefthook still ran without any warnings or errors. I also have to look up every time whether it's called stage_fixed
, stage_changed
, stage_changes
or something else. Editing the lefthook.yml
is something I rarely do and if lefthook runs, I assume that the configuration is valid.
Behavior and configuration changes
There should be printed a warning, if there's a configuration key in the wrong format or not known to lefthook. For example, if I add a stage_changes
key to one of the commands, I'd like to see an warning like:
WARNING: "stage_changes" is not known, maybe you mean "stage_fixed"?
An automatic pre-commit check for changes to the lefthook config file would be nice as well, but could be easily added manually if a lefthook verify
command is added.
Thank you! This is a really good feature to have. I will think it out. Right now lefthook can only notify about deprecated options, and adding a verify
step would be really helpful.
Seconding this. On great advice in another thread, I tried to introduce fail_text
. However, my brain wasn't functioning, as I instead defined a value for error_text
. The job ran still but the error I introduced didn't trigger the text like I assumed would happen. An error stating that I was using an undefined key would be wonderful!