Adopt black for code formatting
See original GitHub issueIn pandas we recently started using black
(https://github.com/psf/black) for automatic code formatting. I don’t like all the style choices that it makes, but I do like that fact that you don’t have to worry any more about code style yourself when writing, or need to comment (or argue) on PRs about code style.
So what are your thoughts on using it for geopandas as well?
If we do it, I think we should add a CI check to enforce it (and add a pre-commit hook that people can use, which will run black when committing). Which does mean that this can make it a bit harder to do a PR as a pass-by contributor (as you might get failures for style).
Anyway, we also did not yet check for PEP8 (flake8) on CI currently, which is something which we should start doing otherwise I think. But since that also introduces possible failing CI due to style, I would personally directly go for black.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:7 (7 by maintainers)
Top GitHub Comments
I’m in favor. I dig black.
I also think if folks don’t know how to run the formatter on their contribution, a maintainer can always run it before merging. That’s kind of @jdmcbr’s suggestion, but it ensures the formatting happens at the point of the contribution.
OK, so black and flake8 are enabled on travis now. Let’s see how it goes for a while, we can always revisit that if it turns out a hurdle or annoyance on PRs.