(front end js) My new favorite tool is the ridiculously named husky package, which allows for configurable git hooks inside of package.json. Specifically what I'm doing now is precommit eslint and prettier, and prepush test:all i.e. people on my team will be unable to commit if they fail lint and unable to push if they fail unit tests. There's of course positives and negatives to this approach but the former signific…
I like this balance better because the end goal is still met: "bad" code doesn't make it to the main git branch.
But it also allows for git workflows which involve frequent commits. (If all tests have to pass for every commit, even locally when the commits may be rebased away, it encourages very large and hard to review commits instead of the smallest commit possible for the given changes.)