tweag / cooked-validators

MIT License
39 stars 11 forks source link

Pre commit hook failure #256

Closed gabrielhdt closed 1 year ago

gabrielhdt commented 1 year ago

When I want to commit, I receive the message

.git/hooks/pre-commit: line 13: /nix/store/8n7a65jpm6nbz992jkplv2qi2xhbnp1m-python3.10-pre-commit-2.20.0/bin/pre-commit: No such file or directory

To reproduce

$ touch foo
$ git add foo
$ git commit

Environment

Niols commented 1 year ago

Just to be sure that we reset the whole thing, can you:

$ rm .git/hooks/*
$ rm .pre-commit-config.yaml
$ direnv reload

(or leave and enter nix develop again if you don't rely on direnv) and then try again?

gabrielhdt commented 1 year ago

Ah I wasn't in a nix develop!

gabrielhdt commented 1 year ago

It works with nix develop .#ci at least.

Niols commented 1 year ago

I think it is actually a known problem of cachix/pre-commit-hooks.nix: it is good at installing hooks, but not so good at uninstalling them, so you end up in inconsistent states if you're not in a world managed by cachix/pre-commit-hooks.nix. Not sure if there is much we can do about this, though.