pgh-public-meetings / city-scrapers-pitt

Pittsburgh City Scrapers: sourcing public meetings in Pittsburgh
https://pgh-public-meetings.github.io/events/
MIT License
19 stars 66 forks source link

Use Black for Python Formatting #144

Closed ben-nathanson closed 3 years ago

ben-nathanson commented 3 years ago

We want to replace 'isort', flake8, and yapf with black. The biggest offering of black is that it does the formatting for the user automatically.

Contributors are spending a great deal of time trying to satisfy style requirements. It's not an ideal developer experience, and a common blocker in pull requests. Black does have different standards from isort/yapf/flake8 but I think we care more about consistent style than any specific style.

I will be using this issue to work through the migration of our repo to black, including Github Actions, documentation, all of our Python code, and probably a few other things I'm forgetting at the moment.

There is a GitHub action that will "Blacken" code - that is modify the code per Black standards when a pull request is created. That may be the next step after this, or we might decide it's better to keep that responsibility with the contributor. I think linting/testing before push is a good habit to develop ¯_(ツ)_/¯.

More on Black here. Black has lots of contributors, is used by several big names, and should be a reliable dependency.