you are viewing a single comment's thread
view the rest of the comments
[–] [B] -4 points 2 years ago* (4 children)

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.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 4 points 2 years ago (3 children)

    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.

  • source
  • parent
  • hideshow 3 child comments
  • [–] [B] -2 points 2 years ago (2 children)

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

  • source
  • parent
  • hideshow 2 child comments
  • [–] 5 points 2 years ago (1 child)

    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.

  • source
  • parent
  • hideshow 1 child comment