Skip to content
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

bugfix: remove before/after options from config json file #535

Closed

Conversation

djacu
Copy link
Contributor

@djacu djacu commented Dec 15, 2024

A recent commit to add ordering priority to the hooks introduced new keys into the pre-commit JSON config file. These keys should not be there are they are not keys pre-commit is aware of and produce warning messages. e.g.:

[WARNING] Unexpected key(s) present on local => treefmt: after, before

This commit fixes it by filter out all keys with names before or after before writing the configuration to file.

Fixes #112

A recent commit to add ordering priority to the hooks introduced new
keys into the pre-commit JSON config file. These keys should not be
there are they are not keys pre-commit is aware of and produce warning
messages. e.g.:

[WARNING] Unexpected key(s) present on local => treefmt: after, before

This commit fixes it by filter out all keys with names `before` or
`after` before writing the configuration to file.
@djacu
Copy link
Contributor Author

djacu commented Dec 15, 2024

I'll note that this method for fixing is a bit ham-fisted and will delete any key with name before or after. It does produce the intended result of fixing the related issue, however, a more precise method would be better.

@djacu
Copy link
Contributor Author

djacu commented Dec 15, 2024

Closing in favor of #536

@djacu djacu closed this Dec 15, 2024
@djacu djacu deleted the djacu/remove-before-after-from-config-json branch December 15, 2024 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[WARNING] Unexpected key(s) present on local => nixpkgs-fmt: types_or
1 participant