exclude option not being processed correctly for pep8 when run as setuptools command
I believe this issue is isolated to the setuptools invocation of flake8 (python setup.py flake8), not the more common flake8 command-line tool.
I have these settings in my project's setup.cfg:
[flake8]
max-line-length = 100
show-source = 1
verbose = 1
exclude = test/*,locales
These values are collected into Flake8Command.options_dict
and passed into flake8.engine.get_style_guide()
. get_style_guide()
calls flake8.engine.get_parser()
which creates a pep8 parser that also independently collects these values from the setup.cfg file. Then the options and parser are both passed into StyleGuide.__init__()
, where the flake8 options stomp on the values provided by the pep8 parser. Unfortunately, pep8 expects the values from its parser, not those handed in from Flake8Command.options_dict
.
Using the config above, it effectively prevents any flake8 style checks from running because rather than comparing candidate files against ['test/*', 'locales']
, it compares them against ['t','e','s','t','/','*',',','l','o','c','a','l','e','s']
. The '*'
item matches everything, so everything gets excluded.