• lemmeBe
    link
    fedilink
    arrow-up
    1
    arrow-down
    5
    ·
    edit-2
    16 hours ago

    No, you don’t.

    To check if people have done what - committed? That’s the only thing they need to do, and they’ll stumble upon a roadblock immediately if the typecheck or lint fails.

    Committing itself won’t be possible… That’s why we have automated pre-commit checks that don’t depend on people remembering to do them manually.

    • FizzyOrange@programming.dev
      link
      fedilink
      arrow-up
      4
      arrow-down
      1
      ·
      15 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.

      • lemmeBe
        link
        fedilink
        arrow-up
        1
        arrow-down
        3
        ·
        12 hours ago

        They’re optional if you make them optional. I didn’t. You do as you please. 😄

        • FizzyOrange@programming.dev
          link
          fedilink
          arrow-up
          3
          ·
          12 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.

          • bamboo@lemm.ee
            link
            fedilink
            arrow-up
            1
            ·
            3 hours ago

            pre-commit also has a free service for open source GitHub repos too. They’ll even push an autofix commit for you if your tools are configured for it