When comparing pyflakes vs flake8, the Slant community recommends flake8 for most people. In the question“What are the best Python code linters?” flake8 is ranked 2nd while pyflakes is ranked 7th. The most important reason people chose flake8 is:
Project-level settings for flake8 are in the tox settings file. It is trivial to run flake8 inside setup.py or pavement.py.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Very fast
Because it looks for errors from a small group of possible mistakes, pyflakes is very fast. When dealing with many lines of code this is a very useful feature. When used in conjunction with an IDE, it checks the code as it's being edited.
Pro Easy installation
The installation process for pyflakes is as easy as it can be. Can be installed with easy_install
or pip
and you are ready to go.
Pro Integration with build tools like tox
Project-level settings for flake8 are in the tox settings file. It is trivial to run flake8 inside setup.py or pavement.py.
Pro Allows usage of and writing of plugins
Flake8 has the ability to run thrid-party plugins, including plugins you can write yourself. Here you can find a few useful plugins.
Pro Easy to ignore files and lines
Add "noqa" comments to files and lines to skip processing. Code comments make it easy to find and review exceptions with grep.
Pro Wraps multiple analysis tools
Flake8 is a wrapper around PyFlakes, pep8, and McCabe Complexity analysis.
Cons
Con Not very powerful
Pyflakes only checks for names that are defined but never used or names that are redefined without being used. It also does not have command line options that offer a degree of control for the tests that you are running.