Revert "Prefer .flake8 if present for options."

The intended behaviour already existed.

This reverts commit db9d4ad8b4.
This commit is contained in:
Ian Cordasco 2016-06-28 20:47:16 -05:00
parent 15745558c1
commit 75e1c1efbf
No known key found for this signature in database
GPG key ID: 656D3395E4A9791A
2 changed files with 13 additions and 15 deletions

View file

@ -41,9 +41,7 @@ class ConfigFileFinder(object):
self.program_name = program_name
# List of filenames to find in the local/project directory
self.project_filenames = (
self.program_config,
) + self.PROJECT_FILENAMES
self.project_filenames = ('setup.cfg', 'tox.ini', self.program_config)
self.local_directory = os.path.abspath(os.curdir)

View file

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