mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-04 20:26:53 +00:00
Don't load local plugins from user config.
This commit is contained in:
parent
f82aab5820
commit
2cadc060d3
1 changed files with 9 additions and 11 deletions
|
|
@ -313,20 +313,18 @@ def get_local_plugins(config_finder, cli_config=None, isolated=False):
|
|||
if cli_config:
|
||||
LOG.debug('Reading local plugins only from "%s" specified via '
|
||||
'--config by the user', cli_config)
|
||||
configs = [config_finder.cli_config(cli_config)]
|
||||
config = config_finder.cli_config(cli_config)
|
||||
else:
|
||||
configs = [
|
||||
config_finder.user_config(),
|
||||
config_finder.local_configs(),
|
||||
]
|
||||
config = config_finder.local_configs()
|
||||
|
||||
section = '%s:local-plugins' % config_finder.program_name
|
||||
for config in configs:
|
||||
for plugin_type in ['extension', 'report']:
|
||||
if config.has_option(section, plugin_type):
|
||||
getattr(local_plugins, plugin_type).extend(
|
||||
config.get(section, plugin_type).strip().splitlines()
|
||||
)
|
||||
for plugin_type in ['extension', 'report']:
|
||||
if config.has_option(section, plugin_type):
|
||||
getattr(local_plugins, plugin_type).extend(
|
||||
c.strip() for c in config.get(
|
||||
section, plugin_type
|
||||
).strip().splitlines()
|
||||
)
|
||||
return local_plugins
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue