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

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

Closed
roberth opened this issue Jun 16, 2021 · 3 comments · Fixed by #536
Closed

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

roberth opened this issue Jun 16, 2021 · 3 comments · Fixed by #536
Labels
bug Something isn't working

Comments

@roberth
Copy link
Contributor

roberth commented Jun 16, 2021

With nixos-unstable, I'm getting warnings like these

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

It appears that the configuration format has changed with a pre-commit update, or at least it has started checking for unknown fields.

@domenkozar domenkozar added the bug Something isn't working label Jun 18, 2021
@mweinelt
Copy link
Contributor

mweinelt commented Dec 15, 2024

And with nixfmt-rfc-style I'm now seeing on unstable

[WARNING] Unexpected key(s) present on local => nixfmt-rfc-style: after, before

@djacu
Copy link
Contributor

djacu commented Dec 15, 2024

I'm seeing the same thing for treefmt on 5d67ea6b4b63378b9c13be21e2ec9d1afc921713 of nixos-unstable

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

@djacu
Copy link
Contributor

djacu commented Dec 15, 2024

Ahh so these are definitely not keys that pre-commit is aware of.
https://github.com/pre-commit/pre-commit/blob/cb14bc2d9c14cceea9e577177f4229e47934351a/pre_commit/hook.py

And it looks like this bug was introduced because of the new ordering options merged earlier today.
#533

I assume the intent was not to have these options appear in the output JSON file but they certain are.

# DO NOT MODIFY
# This file was generated by git-hooks.nix
{
  "default_stages": [
    "pre-commit"
  ],
  "repos": [
    {
      "hooks": [
        {
          "after": [],
          "always_run": false,
          "args": [],
          "before": [],
          "entry": "/nix/store/v79h3cg4m2r80jgrgyn45kcarrf24if7-treefmt/bin/treefmt --fail-on-change --no-cache",
          "exclude": "^$",
          "exclude_types": [],
          "fail_fast": false,
          "files": "",
          "id": "treefmt",
          "language": "system",
          "name": "treefmt",
          "pass_filenames": true,
          "require_serial": false,
          "stages": [
            "pre-commit"
          ],
          "types": [
            "file"
          ],
          "types_or": [],
          "verbose": false
        }
      ],
      "repo": "local"
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants