Automatically run Black in PyCharm on Windows

Jostein Leira
Nov 2 · 4 min read

I often forget to run the code formatter before I commit code to git. This is bad since the following commits will contain irrelevant formatting changes.

I want the code formatter to run automatically. I have heard about git pre-commit hooks but never used them on Windows.

These are the installation steps:

Overview