config: Switch code paths to use 'ConfigFileFinder.ignore_config_files'

Now that the `ConfigFileFinder` has the `.ignore_config_files`
attribute, switch the relevant code paths to utilize this public
attribute.

Tests have been updated to either construct `ConfigFileFinder` or mock
the object appropriately.
This commit is contained in:
Eric N. Vander Weele 2020-01-07 13:03:34 -05:00
parent a5c17c1a19
commit 3d546d448a
4 changed files with 6 additions and 3 deletions

View file

@ -307,7 +307,7 @@ class MergedConfigParser(object):
:rtype:
dict
"""
if isolated:
if self.config_finder.ignore_config_files:
LOG.debug(
"Refusing to parse configuration files due to user-"
"requested isolation"
@ -344,7 +344,7 @@ def get_local_plugins(config_finder, cli_config=None, isolated=False):
flake8.options.config.LocalPlugins
"""
local_plugins = LocalPlugins(extension=[], report=[], paths=[])
if isolated:
if config_finder.ignore_config_files:
LOG.debug(
"Refusing to look for local plugins in configuration"
"files due to user-requested isolation"