this post was submitted on 20 Mar 2025
37 points (100.0% liked)

Programming

19061 readers
133 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 10 hours ago* (last edited 10 hours ago) (1 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.

[–] [email protected] 3 points 9 hours ago (1 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.

[–] [email protected] 1 points 7 hours ago (1 children)

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

[–] [email protected] 2 points 7 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.