When comparing Pylint vs flake8, the Slant community recommends Pylint for most people. In the question“What are the best open source Python static analysis tools?” Pylint is ranked 1st while flake8 is ranked 2nd. The most important reason people chose Pylint is:
Each check in pylint has a unique id, so you can choose to disable or enable that particular message in subsequent executions. Just run `-enable-msg` or `-disable-msg` and the message id.
Ranked in these QuestionsQuestion Ranking
Pro Easily enable or disable a particular message
Each check in pylint has a unique id, so you can choose to disable or enable that particular message in subsequent executions. Just run
-disable-msg and the message id.
Pro Fine-grained control
In addition to the ability to enable or disable warnings, Pylint also gives the developer a great degree of control through command line options. These range from regular expressions to enforce naming conventions to various settings to watch for complexity issues.
Pylint has a configuration file which can be tweaked to choose what kind of warning messages you want. This way you can choose to opt out of receiving warnings that you may consider useless.
Pro Full, detailed reports
Pylint gives very detailed reports of your code. It even provides ASCII tables with detailed statistics about the results.
Data for the previous and current code execution is also available with the difference, allowing you to easily see the progress that you have made.
Pro Great documentation
The documentation is thorough and complete. They provide information for any kind of warning that Pylint may raise and how to deal with them, enable/disable them and how to interpret them.
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.
Con May need to compile from source to install it correctly
There are some dependencies from Logilab that Pylint needs. They can easily be found in the README but trying to install them with easy_install can yield some problems with unresolved dependencies.