-
Notifications
You must be signed in to change notification settings - Fork 5
Python coding style
Jodasue edited this page Dec 8, 2021
·
5 revisions
In order to produce consistent code, we are enforcing pep8 style conventions via flake8 checks on git commits: pep8 style conventions.
The easiest way to do this is to install autopep8 via conda:
conda install -c conda-forge autopep8.
For consistency you should install the following config file in ~/.config/pep8:
[pycodestyle]
ignore = E221, E402
statistics = True
max-line-length = 99
Then you can preview the changes to a code via:
autopep8 --diff <filename>
If you are happy with the proposed changes, you can actually enforce them with:
autopep8 --in-place <filename>