• FizzyOrange
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    10 hours ago

    To check that people ran the pre-commit linters.

    Committing itself won’t be possible

    That’s not how pre-commit hooks work. They’re entirely optional and opt-in. You need CI to also run them to ensure people don’t forget.

      • FizzyOrange
        link
        fedilink
        arrow-up
        2
        ·
        8 hours ago

        No, they’re inherently optional in Git. There’s no way to “check in” a git hook. You have to put in your README

        Clone the repo and then please run pre-commit install! Oh and whatever you do don’t git commit --no-verify!

        You definitely need to actually check the lints in CI. It’s very easy though, just add pre-commit run -a to your CI script.