3 ms·
> A pre-commit hook in your revision control system can block checking in code that doesn't pass a lint check. That would reduce your CI build failures. Omg do
by catdog 8y ago
> A pre-commit hook in your revision control system can block checking in code that doesn't pass a lint check. That would reduce your CI build failures.
Omg don't use commit hooks for that, just make it as easy to use as possible for the developer (e.g. integration into the editor/IDE). For verifying such things CI is the way to go.
Simply never commit directly to your development branch, use feature branches and pull/merge requests.
1. Someone else (ideally the most experienced Person(s) available but even any second pair of eyes is better than nothing) can and should review the code
2. Hook it up to the CI, the CI should merge it into the target branch locally and do its thing, as long as a pull request fails the CI it will not be merged
Software (e.g. Gitlab) to implement such a workflow is freely available, you just have to set it up but that's worth the effort.