Hacker News new | past | comments | ask | show | jobs | submit login

how do you do this? do you have a jenkins server running that does the formatting? i would love to set this up because while i use black religiously i cannot for the life of me convince my boss get in the habit of using it (which is crazy because your commits are always fighting on whitespace).

Use pre-commit [0] so people can run it client side for quick feedback, and then use whatever CI you have (Jenkins, Travis, Circle, Azure) to enforce this. The important parts are the majority of people agree to do it, and that you have CI to be the "bad cop"/fall guy so it never becomes personal.

(edit: black has pre-commit support [1], and it's easier than setting up and maintaining your own hooks IMO)

[0] https://pre-commit.com/

[1] https://github.com/python/black/blob/master/README.md#versio...

See https://github.com/shosca/django-sorcery/blob/master/Makefil... for example

Run that target as part of the test

Black's README explains how to do it: https://github.com/python/black#version-control-integration

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact