Priesemann-Group / covid19_inference

Bayesian python toolbox for inference and forecast of the spread of the Coronavirus
GNU General Public License v3.0
73 stars 70 forks source link

Add black formatter #18

Closed jdehning closed 4 years ago

jdehning commented 4 years ago

Add a pre-commit hook to format submitted code with black

pSpitzner commented 4 years ago

I suggest we tackle this along with Travis CI. Automated testing feels more urgent, anyway.

pSpitzner commented 4 years ago

So travis works as of 62bffca5b9eddc1c60546a97cce9dd0899094d20. I decided against adding black formatting into the travis test, for now.

Instead, anyone who wants to push to the repo can setup black as a pre-commit hook locally (as suggested by the black developers). The required .pre-commit-config.yaml is now in the repo.

conda install -c conda-forge pre-commit
pre-commit install

and thereafter, black should automatically run on the python files that are part of the commit.