| ▲ | Marsymars 2 hours ago | |
> Can people give examples of how they use pre-commit hooks that _cannot_ be replaced by a combination of the following? I can't, because the point of our pre-commit use isn't to run logic in hooks that can't be run otherwise. e.g. We use pre-commit to enforce that our language's whitespace formatting has been applied. This has the same configuration in the IDE, but sometimes devs ignore IDE warnings or just open files in a text editor for a quick edit and don't see IDE warnings or w/e. "Replaced by CI" isn't really meaningful in our context - pre-commit is just a tool that runs as part of CI - some things get done as pre-commit hooks because they're fast and it's a convenient place to put them. Devs are encouraged to also run pre-commit locally, but there's no enforcement of this. > Do you run tests? How do you know _which_ tests to run, and not just run every test CI would run, which could be slow? We have performance metrics for pre-commit hooks and pre-push hooks. I forget the exact numbers, but we want stuff to "feel" fast, so e.g. if you're rebasing something locally with a few dozen commits it should only take seconds. Pre-push hooks have a bit more latitude. | ||