• not_woody_shaw
    link
    fedilink
    English
    arrow-up
    3
    ·
    13 days ago

    Yeah, but do you really want CI making commits in your git history? Haven’t thought too much about it but I’m assuming it could get gnarly. In larger teams I often see stuff that could not possibly have passed the existing pre-commit hook. Actually on one of our projects the unit tests run on precommit and it takes 8 minutes on my machine, so you could call me a git hook skeptic.

    • brian@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      13 days ago

      No, CI validates that the hooks or formatter ran, and fails if not. in theory it shouldn’t ever fail but it’s to catch the stuff that couldn’t have passed the commit hook.

      the hooks are easy to turn off and can be hard to get to reliably run (90% of the time they’re fine, but all of the tools that run git commands sometimes do weird things), but they’re a best effort kind of thing.

      unit tests on precommit are a little annoying, especially when it takes that long. that’s better suited to running in ci afterwards since there’s no advantage to running before you commit. formatter takes like 200ms max for affected files? you won’t notice, and it ends up as part of the one commit

      • not_woody_shaw
        link
        fedilink
        English
        arrow-up
        1
        ·
        9 days ago

        Sounds like a plan, maybe I can try used FJ again, it does looks nicer than prettier or biome.