Hacker News new | ask | show | jobs
by StavrosK 2510 days ago
I generally do it on both stages. I run pre-commit (the Python project) locally on just the files that changed, which catches 99% of problems, reformats things with Black, etc. Then, I run pre-commit again on CI, but this time it goes through all files, which catches any problems that might have fallen through initially.

This is both very fast locally and very accurate. Plus, a dev that didn't bother to install pre-commit won't ruin the entire codebase, they will instead have to go through lengthy fix/push/wait/refix cycles, so they're incentivized to install pre-commit locally to run the linters quickly.