Flake8 3.0.2 does not report errors when run with setuptools
Please provide the following version information
-
Version of Python which has Flake8 installed: Python 2.7.11
-
How you installed Flake8: pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
-
Version of setuptools installed: 21.0.0
-
Version of Flake8 installed: 3.0.2 (mccabe: 0.5.1, pyflakes: 1.2.3, pycodestyle: 2.0.0) CPython 2.7.11 on Linux
Please describe the problem or feature
When Flake8 is run via setuptools, no style errors are reported. Using flake8-issue.tar.gz as an example, you will see the following behavior
% flake8
./foo/__init__.py:3:4: E111 indentation is not a multiple of four
./foo/bar/__init__.py:2:1: F401 'pdb' imported but unused
% ./setup.py flake8
running flake8
The problem appears to be that setuptools_command.Flake8.run
isn't ever actually reporting the errors. If I change the method to look like
def run(self):
"""Run the Flake8 application."""
self.flake8.run_checks(list(self.distribution_files()))
self.flake8.formatter.start()
self.flake8.report_errors()
self.flake8.report_statistics()
self.flake8.report_benchmarks()
self.flake8.formatter.stop()
self.flake8.exit()
Then running via setuptools works as one would expect. I'm not familiar enough with the internals to say whether this is the best fix or not but it does seem to address the problem.