Most of the PEP 8 recommendations are adopted, including the restrictive 79 character limit per line. Ignored/excluded PEP 8 rules are listed in the [flake8] block of setup.cfg and are described in the adjacent comments.
Travis CI is now configured to run the linter as a preliminary build stage for all builds. If flake8 emits a warning or error, the main install+test build stage will be aborted, and Travis will report the overall build as failed.
Detailed summary
Selects the flake8 Python module as the tool to be used for checking Python style. This command line utility wraps the PyFlakes, pycodestyle (formerly pep8), and McCabe (for checking code complexity) tools.
flake8 is probably the most popular Python linter, and it was straightforward to setup these lightweight checks.
Pylint is also a popular tool, but I am less familiar with it.
Adds linting rules to setup.cfg
The configuration could alternatively be stored in hidden file .flake8, if preferred.
Applies autopep8 tool to all Python files currently in the project
Manually fixes remaining flake8 error code violations that autopep8 was unable to correct and fixed some ugly indentation that resulted from the automated conversion.
Tried to eliminate the "considered deprecated" usages of \ line continuation characters in favor of explicit delimiters () and hanging indents.
To-do
[ ] Switch Jenkins server and workspace
[ ] Add flake8 check to Jenkins builds
[ ] Continue updating Travis CI YAML. Should apt-based addons be replaced by virtualenv?
[ ] Refactor the heavily-duplicated parts of the code
Most of the PEP 8 recommendations are adopted, including the restrictive 79 character limit per line. Ignored/excluded PEP 8 rules are listed in the
[flake8]
block ofsetup.cfg
and are described in the adjacent comments.Travis CI is now configured to run the linter as a preliminary build stage for all builds. If
flake8
emits a warning or error, the main install+test build stage will be aborted, and Travis will report the overall build as failed.Detailed summary
flake8
Python module as the tool to be used for checking Python style. This command line utility wraps the PyFlakes,pycodestyle
(formerlypep8
), and McCabe (for checking code complexity) tools.flake8
is probably the most popular Python linter, and it was straightforward to setup these lightweight checks.setup.cfg
.flake8
, if preferred.autopep8
tool to all Python files currently in the projectflake8
error code violations thatautopep8
was unable to correct and fixed some ugly indentation that resulted from the automated conversion.\
line continuation characters in favor of explicit delimiters()
and hanging indents.To-do
flake8
check to Jenkins buildsaddons
be replaced byvirtualenv
?