[elbe-devel] RFC: using pep8 coding style
Manuel Traut
manuel.traut at linutronix.de
Tue Dec 19 16:30:52 CET 2017
Hi,
i would like to have a common coding style in elbe.
PEP8 [0] describes a style-guide for python code.
There is tooling to check the coding style and for automatic refactoring.
So it would be easy to ensure that we follow this coding style in the future.
$ cd elbe
$ pycodestyle --statistics .
reports about 7000 coding style violations currently. After running
$ autopep8 -i -r -a -a -j 5 .
pycodestyle reports just about 100 violations. Most of them are 'E501 line to
long' and some others. All can be easily fixed 'by hand':
7 E211 whitespace before '('
6 E265 block comment should start with '# '
3 E266 too many leading '#' for block comment
2 E402 module level import not at top of file
98 E501 line too long (82 > 79 characters)
7 E741 ambiguous variable name 'l'
However an initial conversion introduces a lot of changes and so lowers the
usability of git-blame:
$ git diff | diffstat | tail -1
94 files changed, 6206 insertions(+), 4850 deletions(-)
elbe is currently about 12k of python. So nearly every other line will be
changed by the cleanup!
I would like to do the conversion in multiple patches. One big patch, that
applies the changes from autopep8. And one single patch for each kind of error
detected by pycodestyle.
What do you think?
Regards,
Manuel
[0] https://www.python.org/dev/peps/pep-0008/
--
------------------------------------------------
Linutronix GmbH
fon +49 7556 25999 16
Firmensitz: D-88690 Uhldingen, Bahnhofstraße 3
Registergericht: Freiburg i. Br., HRB 700 806;
Geschäftsführer: Heinz Egger, Thomas Gleixner
More information about the elbe-devel
mailing list