I have terrible code habits on my personal projects. PHPStorm is configured for formatting, but I’ll do lazy things like omit return types and only run tests right before I’m done with a session. If a test fails I’ll leave it for next time (sometimes).
So, I’m revisiting and old friend – GrumPHP. Essentially, it uses git-hooks on commit (pre-commit?) to run some quality tooling. Like – run my test suite and phpstan.
The feedback loop is really interesting here – because I know I can’t commit unless my quality checks pass I tend to make smaller commits.
Linked From