-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support new config file format #319
Comments
Sounds cool! But I have concerns about how it would play with overriding feature. I mean, we support It would be confusing if we have both |
Good point! I think for this case we shouldn’t support overriding feature. We just need to define priority order and use only one config file. Same as eslint currently does:
For global it could be something like this:
For local:
|
It seems like it would be best to treat any config file without You could get the core config file path via this regex [regex101]: ^\.?lefthook\.(yml|yaml|json) And any local configs via this regex [regex101]: ^\.?lefthook-local\.(yml|yaml|json) Valid exampleAll of these scenarios would be supported: current
new dot configs
mixed
For config files conventions are pretty common these days. Invalid exampleMultiple global or local configs would throw an error.
|
Wow, it makes sense! What do you think about default config file? I guess we could change it to be Why do you think we should support JSON format? What is the potential use case? Do you have a will to prepare a draft PR for this change? |
Something I would add to this is to display a warning when multiple global config files are found, and say which is being used. This could be a pretty frustrating situation when you have both, trying to iterate on the file, and not see your changes taking an effect until you eventually discover that a different file is loading. |
It will be really cool to add
.lefthook.yml
(with dot in the beginning) config file format support. Just to align with other libs:The text was updated successfully, but these errors were encountered: