pip install pre-commit pre-commit install
at least once.
This is not strictly speaking necessary, but what it does is to automatically check formatting on each commit, and to reformat as necessary. So, even if your changes are incorrectly formatted, this will be fixed and you simply commit a second time.
Let me know how it works for y’all!