[elbe-devel] using pep8 coding style

Manuel Traut manut at linutronix.de
Wed Dec 20 22:11:40 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'

The first patch is the result of using autopep8.

Each of the following patches was written by hand to remove one kind of error
detected by pycodestyle.

The series also reduces the number of pylint reported errors from 892 to 784.


 docs/conf.py                            |    6 
 elbe                                    |    5 
 elbepack/aptpkgutils.py                 |   60 -
 elbepack/aptprogress.py                 |   67 +-
 elbepack/asciidoclog.py                 |   31 
 elbepack/asyncworker.py                 |  601 +++++++++---------
 elbepack/cdroms.py                      |  227 ++++---
 elbepack/commands/add.py                |   16 
 elbepack/commands/adjustpkgs.py         |   46 -
 elbepack/commands/bootup-check.py       |   37 -
 elbepack/commands/buildchroot.py        |  106 +--
 elbepack/commands/buildsysroot.py       |   24 
 elbepack/commands/check_updates.py      |   63 +
 elbepack/commands/chg_archive.py        |   51 -
 elbepack/commands/chroot.py             |   39 -
 elbepack/commands/control.py            |  144 ++--
 elbepack/commands/daemon.py             |   27 
 elbepack/commands/db.py                 |    9 
 elbepack/commands/debianize.py          |   13 
 elbepack/commands/diff.py               |  101 +--
 elbepack/commands/gen_update.py         |   71 +-
 elbepack/commands/genlicence.py         |   20 
 elbepack/commands/get_archive.py        |   24 
 elbepack/commands/hdimg.py              |   51 -
 elbepack/commands/init.py               |  165 +++--
 elbepack/commands/initvm.py             |   82 +-
 elbepack/commands/mkcdrom.py            |   97 +--
 elbepack/commands/parselicence.py       |  247 +++----
 elbepack/commands/pbuilder.py           |   44 -
 elbepack/commands/pin_versions.py       |   32 
 elbepack/commands/pkgdiff.py            |   45 -
 elbepack/commands/preprocess.py         |   13 
 elbepack/commands/prjrepo.py            |   24 
 elbepack/commands/remove_sign.py        |    5 
 elbepack/commands/setsel.py             |   23 
 elbepack/commands/show.py               |   29 
 elbepack/commands/sign.py               |    8 
 elbepack/commands/toolchainextract.py   |   58 +
 elbepack/commands/updated.py            |   69 +-
 elbepack/commands/validate.py           |   21 
 elbepack/commands/xsdtoasciidoc.py      |   21 
 elbepack/config.py                      |    2 
 elbepack/daemons/soap/__init__.py       |   28 
 elbepack/daemons/soap/authentication.py |   31 
 elbepack/daemons/soap/datatypes.py      |    3 
 elbepack/daemons/soap/esoap.py          |  288 ++++----
 elbepack/daemons/soap/faults.py         |  172 +++--
 elbepack/db.py                          | 1026 ++++++++++++++++----------------
 elbepack/dbaction.py                    |  166 +++--
 elbepack/debianize/barebox.py           |   67 +-
 elbepack/debianize/base.py              |  169 ++---
 elbepack/debianize/debianize.py         |   10 
 elbepack/debianize/kernel.py            |   90 +-
 elbepack/debianize/uboot.py             |   16 
 elbepack/debianreleases.py              |   26 
 elbepack/debpkg.py                      |   64 +
 elbepack/directories.py                 |   20 
 elbepack/dosunix.py                     |   29 
 elbepack/dump.py                        |  137 ++--
 elbepack/efilesystem.py                 |  223 +++---
 elbepack/elbeproject.py                 |  584 ++++++++++--------
 elbepack/elbexml.py                     |  191 +++--
 elbepack/filesystem.py                  |  109 +--
 elbepack/finetuning.py                  |  217 ++++--
 elbepack/fstab.py                       |   61 -
 elbepack/gpg.py                         |   54 -
 elbepack/hdimg.py                       |  484 +++++++++------
 elbepack/initvmaction.py                |  344 ++++++----
 elbepack/kvm.py                         |   10 
 elbepack/licencexml.py                  |   58 -
 elbepack/pbuilder.py                    |  116 ++-
 elbepack/pbuilderaction.py              |   92 +-
 elbepack/pkgarchive.py                  |  174 ++---
 elbepack/pkgutils.py                    |  166 +++--
 elbepack/projectmanager.py              |  535 ++++++++--------
 elbepack/repomanager.py                 |  371 +++++++----
 elbepack/rfs.py                         |  235 ++++---
 elbepack/rpcaptcache.py                 |  227 ++++---
 elbepack/shellhelper.py                 |   15 
 elbepack/soapclient.py                  |  361 +++++++----
 elbepack/templates.py                   |   38 -
 elbepack/toolchain.py                   |   65 +-
 elbepack/treeutils.py                   |  106 +--
 elbepack/updated.py                     |  479 +++++++-------
 elbepack/updated_monitors.py            |   59 -
 elbepack/updatepkg.py                   |   98 +--
 elbepack/validate.py                    |   16 
 elbepack/version.py                     |    2 
 elbepack/virtapt.py                     |  185 ++---
 elbepack/xmldefaults.py                 |  261 ++++----
 elbepack/xmlpreprocess.py               |   19 
 elbepack/ziparchives.py                 |   27 
 setup.py                                |   61 +
 test/updated.py                         |   94 +-
 94 files changed, 6351 insertions(+), 4952 deletions(-)




More information about the elbe-devel mailing list