mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-04 12:16:53 +00:00
Merge branch 'prefer-.flake8' into 'master'
Prefer `.flake8` if present for options. This is a reprise of !63 for 3.0. See merge request !64
This commit is contained in:
commit
7f3783d109
2 changed files with 20 additions and 18 deletions
|
|
@ -41,7 +41,9 @@ class ConfigFileFinder(object):
|
|||
self.program_name = program_name
|
||||
|
||||
# List of filenames to find in the local/project directory
|
||||
self.project_filenames = ('setup.cfg', 'tox.ini', self.program_config)
|
||||
self.project_filenames = (
|
||||
self.program_config,
|
||||
) + self.PROJECT_FILENAMES
|
||||
|
||||
self.local_directory = os.path.abspath(os.curdir)
|
||||
|
||||
|
|
|
|||
|
|
@ -42,28 +42,28 @@ def test_cli_config():
|
|||
@pytest.mark.parametrize('args,expected', [
|
||||
# No arguments, common prefix of abspath('.')
|
||||
([],
|
||||
[os.path.abspath('setup.cfg'),
|
||||
os.path.abspath('tox.ini'),
|
||||
os.path.abspath('.flake8')]),
|
||||
[os.path.abspath('.flake8'),
|
||||
os.path.abspath('setup.cfg'),
|
||||
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')]),
|
||||
# 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/.flake8'),
|
||||
os.path.abspath('flake8/setup.cfg'),
|
||||
os.path.abspath('flake8/tox.ini'),
|
||||
os.path.abspath('flake8/.flake8'),
|
||||
os.path.abspath('.flake8'),
|
||||
os.path.abspath('setup.cfg'),
|
||||
os.path.abspath('tox.ini'),
|
||||
os.path.abspath('.flake8')]),
|
||||
os.path.abspath('tox.ini')]),
|
||||
# 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/tox.ini'),
|
||||
os.path.abspath('flake8/.flake8'),
|
||||
os.path.abspath('flake8/setup.cfg'),
|
||||
os.path.abspath('flake8/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."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue