Use a code formatter
I'd like to try out using a the amvb/black code formatter. For those unfamiliar there is a right up here.
The long and short of it is that we add an additional check on code formatting to the CI - essentially a program takes over all formatting options. This is advantages as it reduces the amount of style/syntax differences between difference parts of the code and will makes code review easier as there will never be any style questions.
There are 3 ways to interact with it
- For casual developers, they can just submit the code as-is, it will fail on 'code formatting and one of us can just run it through the program before it is merged.
- Anyone can easily
pip
install black, then just runblack FILENAME.py
to format and commit (ensuring it passes the CI). - In a few lines you can add a pre-commit hook which will automatically "blacken" the code before it is committed.
@isobel.romero-shaw @colm.talbot @charlie.hoy (+ anyone else) what are peoples thoughts?