Skip to content

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

Open

Description

@pokey

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

Activity

  1. fidgetingbits commented on Jul 2, 2024

    @fidgetingbits
    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?

  2. pokey commented on Jul 2, 2024

    @pokey
    MemberAuthor

    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

  3. fidgetingbits commented on Jul 3, 2024

    @fidgetingbits
    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?

  4. pokey commented on Jul 3, 2024

    @pokey
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions