pycodestyle and flake8

pycodestyle (formerly pep8is a tool that has only one purpose; it provides only style checking against code conventions defined in PEP 8. This is the main difference from Pylint that has many more additional features. This is the best option for programmers that are interested in automated code style checking only for the PEP 8 standard, without any additional tool configuration, as in Pylint's case.

pycodestyle can be installed with pip as follows:

$ pip install pycodestyle

When run on the Buildout's bootstrap.py script, it will give the following short list of code style violations:

$ wget -O bootstrap.py https://bootstrap.pypa.io/bootstrap-buildout.py -q
$ pycodestyle bootstrap.py
bootstrap.py:118:1: E402 module level import not at top of file bootstrap.py:119:1: E402 module level import not at top of file bootstrap.py:190:1: E402 module level import not at top of file bootstrap.py:200:1: E402 module level import not at top of file

The main difference from Pylint's output is its length. pycodestyle concentrates only on style, so it does not provide any other warnings, such as unused variables, too long function names, or missing docstrings. It also does not give a rating. And it really makes sense because there is no such thing as partial consistency or partial conformance. Any, even the slightest, violation of style guidelines makes the code immediately inconsistent.

The code of pycodestyle is simpler than Pylint's and its output is easier to parse, so it may be a better choice if you want to make your code style verification part of a continuous integration process. If you are missing some static analysis features, there is the flake8 package that is a wrapper on pycodestyle and a few other tools that are easily extendable and provide a more extensive suite of features. These include the following: