cursorless icon indicating copy to clipboard operation
cursorless copied to clipboard

Don't install pre-commit hooks in nix flake

Open pokey opened this issue 1 year ago • 4 comments

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

pokey avatar Jul 02 '24 16:07 pokey

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?

fidgetingbits avatar Jul 02 '24 16:07 fidgetingbits

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

pokey avatar Jul 02 '24 17:07 pokey

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?

fidgetingbits avatar Jul 03 '24 00:07 fidgetingbits

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

pokey avatar Jul 03 '24 07:07 pokey