Skip to content

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, in Nix, 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`, in Nix, before writing the configuration to file.

Fixes cachix#112
@domenkozar
Copy link
Member

Thank you!

@domenkozar domenkozar merged commit 4c8e75e into cachix:master Dec 15, 2024
sandydoo added a commit that referenced this pull request Dec 15, 2024
Consolidates previous work from #533 and #536.

- Removes `before` and `after` from the `raw` config. These are not valid
  pre-commit configuration options and should not be here.
- Removes code to filter out `before` and `after` from the `raw` config.
  There's nothing to filter out if they're not in the config in the
  first place.
- Set `id` to the attr name of the hook, instead of the `name`. This
  corrects a mistake made in the module transition (#397). Technically,
  a breaking change, but we haven't had feedback from the initial
  mistake.
- Expose `id` in options.
sandydoo added a commit that referenced this pull request Dec 15, 2024
Consolidates previous work from #533 and #536.

- Removes `before` and `after` from the `raw` config. These are not valid
  pre-commit configuration options and should not be here.
- Removes code to filter out `before` and `after` from the `raw` config.
  There's nothing to filter out if they're not in the config in the
  first place.
- Set `id` to the attr name of the hook, instead of the `name`. This
  corrects a mistake made in the module transition (#397). Technically,
  a breaking change, but we haven't had feedback from the initial
  mistake.
- Expose `id` in options.
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

2 participants