I've put it in my git pre-commit hook instead. https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
Not sure why I had this ignored to begin with.