Add minimal code to handle --prepend-config

Add code to handle config files specified with the --prepend-config
argument.

Options specified in prepend files get a higher precedence than flake8
defaults but a lower one than user configs. This allows to override
the defaults without affecting the behaviour of user and local config
files.

This implements a solution for issue #349
This commit is contained in:
Germain Chazot 2018-07-24 23:11:24 +01:00 committed by Germain Chazot
parent 4aa4eef0e7
commit 4f3087b369
6 changed files with 111 additions and 45 deletions

View file

@ -31,7 +31,7 @@ def test_get_local_plugins_uses_cli_config():
def test_get_local_plugins():
"""Verify get_local_plugins returns expected plugins."""
config_fixture_path = 'tests/fixtures/config_files/local-plugin.ini'
config_finder = config.ConfigFileFinder('flake8', [], [])
config_finder = config.ConfigFileFinder('flake8', [], [], [])
with mock.patch.object(config_finder, 'local_config_files') as localcfs:
localcfs.return_value = [config_fixture_path]