mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-07 21:44:18 +00:00
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:
parent
4aa4eef0e7
commit
4f3087b369
6 changed files with 111 additions and 45 deletions
|
|
@ -26,7 +26,7 @@ def test_aggregate_options_with_config(optmanager):
|
|||
"""Verify we aggregate options and config values appropriately."""
|
||||
arguments = ['flake8', '--config', CLI_SPECIFIED_CONFIG, '--select',
|
||||
'E11,E34,E402,W,F', '--exclude', 'tests/*']
|
||||
config_finder = config.ConfigFileFinder('flake8', arguments, [])
|
||||
config_finder = config.ConfigFileFinder('flake8', arguments, [], [])
|
||||
options, args = aggregator.aggregate_options(
|
||||
optmanager, config_finder, arguments)
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ def test_aggregate_options_when_isolated(optmanager):
|
|||
"""Verify we aggregate options and config values appropriately."""
|
||||
arguments = ['flake8', '--isolated', '--select', 'E11,E34,E402,W,F',
|
||||
'--exclude', 'tests/*']
|
||||
config_finder = config.ConfigFileFinder('flake8', arguments, [])
|
||||
config_finder = config.ConfigFileFinder('flake8', arguments, [], [])
|
||||
optmanager.extend_default_ignore(['E8'])
|
||||
options, args = aggregator.aggregate_options(
|
||||
optmanager, config_finder, arguments)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue