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
pre-commit
can't find modules
#238345
Comments
I was able to replicate this by using the flake.nix above and adding the following repos:
- repo: meta
hooks:
- id: check-hooks-apply It was probably caused by this: #235123. I'm surprised because I thought that pre-commit did its magic in virtualenvs built for the job. Perhaps this is not the case for the "meta" repo. I'd love it if there were a smart fix which both kept pre-commit from cluttering up the PYTHONPATH (that's what the above PR fixes) and also didn't break pre-commit in this way. If such a fix doesn't show up soon, I won't complain about just reverting that PR. It's probably now brokener than it was 😞 . |
It's only the # .pre-commit-config.yaml
repos:
- repo: meta
hooks:
- id: check-hooks-apply
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace ...works half-way...
Other package managers have solved this. For instance, you can
I don't know how they achieve this. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Just a wild guess, did you try to remove all the installed hooks and run |
Describe the bug
pre-commit
just doesn't seem to work for me any longer.Steps To Reproduce
I have a
flake.nix
like this:Running
pre-commit run --all-files
in the Nix env fails.Expected behavior
pre-commit run --all-files
works. This was working until the last week or two I think.Notify maintainers
Metadata
The
nixpkgs
rev for the flake is at7cc30fd5372ddafb3373c318507d9932bd74aafe
.Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: