Pre-commit is a python package that helps prevent wrong code getting into a commit. It automates the checking such that small bugs are caught early. It can also be customised!
Hopefully you agree that this codebase is in need of cleaning. But can we prevent these little errors from accidentally getting into our codebase?