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

Don't install pre-commit hooks in nix flake #2461

Open
pokey opened this issue Jul 2, 2024 · 4 comments
Open

Don't install pre-commit hooks in nix flake #2461

pokey opened this issue Jul 2, 2024 · 4 comments

Comments

@pokey
Copy link
Member

pokey commented Jul 2, 2024

Why do we install pre-commit hooks in our nix flake? I would be strongly inclined to remove that step, but maybe there's some reason we have to do this as setting up the nix flake? Totally missed that that was what was happening in #1908

cc/ @auscompgeek @fidgetingbits

@fidgetingbits
Copy link
Collaborator

It's not required no. Since it's a development shell, and I assume people using it would be committing things, it made sense to install the hooks? I don't mind removing it, but also curious why you think it's bad? Does it clobber existing tools if you already had them and then test the dev shell or something?

Lots of flakes do it afaik, but also would be ok to just print a message in the shellHook saying it pre-commit install can be run if needed?

@pokey
Copy link
Member Author

pokey commented Jul 2, 2024

Just feels a bit invasive. I don't have them installed locally so was surprised when I couldn't commit something and couldn't figure out why. Turned out it was because I had tested out the flake PR

For me, setting up the flake shouldn't have any impact on non-flake setup. I had thought isolation was one of the goals

@fidgetingbits
Copy link
Collaborator

Ah interesting, that makes sense. Bad assumption on my part. I'll send a PR to remove it.

Why don't you use pre-commit locally out of curiosity. I specifically wonder about cases where it would catch stuff that can't be auto fixed by running it in CI?

@pokey
Copy link
Member Author

pokey commented Jul 3, 2024

I prefer my git commit to be dumb, fast, and predictable. It's plumbing

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

No branches or pull requests

2 participants