Fix project config file discovery

Flake8 3.0 was stopping once it found the current directory but the
historical behaviour (that we didn't intend to break) searched past
that (towards root) until it found one of the project/local config
file names that could be read.

Closes #181
This commit is contained in:
Ian Cordasco 2016-07-26 09:32:39 -05:00
parent f82b5d62d0
commit df2fa18a08
No known key found for this signature in database
GPG key ID: 656D3395E4A9791A
5 changed files with 22 additions and 27 deletions

View file

@ -43,27 +43,15 @@ def test_cli_config():
# No arguments, common prefix of abspath('.')
([],
[os.path.abspath('setup.cfg'),
os.path.abspath('tox.ini'),
os.path.abspath('.flake8')]),
os.path.abspath('tox.ini')]),
# Common prefix of "flake8/"
(['flake8/options', 'flake8/'],
[os.path.abspath('flake8/setup.cfg'),
os.path.abspath('flake8/tox.ini'),
os.path.abspath('flake8/.flake8'),
os.path.abspath('setup.cfg'),
os.path.abspath('tox.ini'),
os.path.abspath('.flake8')]),
[os.path.abspath('setup.cfg'),
os.path.abspath('tox.ini')]),
# Common prefix of "flake8/options"
(['flake8/options', 'flake8/options/sub'],
[os.path.abspath('flake8/options/setup.cfg'),
os.path.abspath('flake8/options/tox.ini'),
os.path.abspath('flake8/options/.flake8'),
os.path.abspath('flake8/setup.cfg'),
os.path.abspath('flake8/tox.ini'),
os.path.abspath('flake8/.flake8'),
os.path.abspath('setup.cfg'),
os.path.abspath('tox.ini'),
os.path.abspath('.flake8')]),
[os.path.abspath('setup.cfg'),
os.path.abspath('tox.ini')]),
])
def test_generate_possible_local_files(args, expected):
"""Verify generation of all possible config paths."""