-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Is your feature request related to a problem? Please describe.
Implementing a consistent code format and avoiding code format related reviews and delays is a chore.
Describe the solution you'd like
To avoid needless code style reviews and edits and manual changes, I propose we move to using python black, as it is now considered stable and is becoming widely used. Black is a highly opinionated code formatter, which will help us have consistent code formatting.
More info: https://black.readthedocs.io/en/stable/
It has it's own CI workflow that integrates with GitHub so we can easily add it in and get uniformly formatted code for the whole project. It has its own test suite etc. Widely used. Great!
Describe alternatives you've considered
Alternative is to keep it as it is and have vastly different code formats across the same file, or spend time manually editing each contributors code formatting habits. There are also other alternatives but none as widely used and supported as black.
Additional context
It's very easy to set up your IDE to use black, or to set up a pre-hook commit e.g. on GitKraken to format your code after you write it. We should also use a github action that checks against black (not sure if it can auto suggest changes and a new commit like some other GitHub actions.
One problem is that moving to black means using spaces instead of tabs, so the project files need to be changed, and the editor config. I have opened PR #42 to address this.