-
Notifications
You must be signed in to change notification settings - Fork 162
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
Extend yamllint
hook
#398
Extend yamllint
hook
#398
Conversation
eb418b0
to
206bc45
Compare
Sorry for the mess, we revamed module structure in #397, could you port these changes over? |
d4a9d76
to
20fbe2c
Compare
error: evaluation aborted with the following error message: 'cannot find attribute `hooks.yamllint.settings.relaxed'' |
@domenkozar I believe I fixed all warnings and rebased onto master again. Ready for review/merge. |
2602c35
to
bf4ca5f
Compare
bf4ca5f
to
34fdf24
Compare
Ci is failing |
I added a couple of options to the
yamllint
hook, as so far it was only possible to pass a path to the configuration file.In some comments, I also reasoned why some options weren't added as they do not make sense for a pre-commit hook.
Similar to how I did it for the
typos
hook, there is now also an option to pass a multiline string as configuration toyamllint
. Additionallyyamllint
allows for a serialized configuration, but the multiline string configuration option is the preferred way. Of course just providing a path to a configuration file remains possible.The behaviour of the hook itself mostly stayed the same, although the
relaxed
option was removed in favour of a more generalizedpreset
option, that allows us to easily add presets, should more ever be added toyamllint
.A pre-commit hook only makes sense, if it prevents you from committing if errors were found, so
--strict
should definitely be the default.Breaking changes:
settings.yamllint.relaxed = true;
is nowsettings.yamllint.preset = "relaxed";
settings.yamllint.strict
was added and defaults totrue
➡️ strict error checking for hookAdditional changes:
For some hooks I recently worked on, I noticed that I was shadowing the top-level attribute
config
, which is never a good idea, so I changed the multiline configuration options toconfiguration
.Affected hooks are
typos
andvale
. The options were only added recently.