Specifying refs for use in CI?
From https://pre-commit.com/#usage-in-continuous-integration:
pre-commit can also be used as a tool for continuous integration. For instance, adding pre-commit run --all-files as a CI step will ensure everything stays in tip-top shape. To check only files which have changed, which may be faster, use something like pre-commit run --from-ref origin/HEAD --to-ref HEAD
Is there any way to specify the refs? Basically I want iterative improvement in CI where modified files are checked, not requiring every existing file to be in compliance.
I'd love to have that, especially for monorepos! It doesn't exist, I'm not sure yet how to implement it :)
Instead of using nix flake check, you could run your pre-commit commands from within nix develop. Using your example: nix develop -c pre-commit run --from-ref origin/HEAD --to-ref HEAD