summaryrefslogtreecommitdiff
path: root/src/flake8
diff options
context:
space:
mode:
authorEric N. Vander Weele <ericvw@gmail.com>2020-01-12 15:13:41 -0800
committerEric N. Vander Weele <ericvw@gmail.com>2020-01-12 23:19:26 -0500
commit77b2506071bec65d75e5259e00ceefb91ae50cf1 (patch)
treeba1ab41f0d9e4f422a00649b98c98c120ed7771c /src/flake8
parent153032f778d609b206cbfdb56ddf27e6f46925c4 (diff)
downloadflake8-77b2506071bec65d75e5259e00ceefb91ae50cf1.tar.gz
config: Switch code paths to use 'ConfigFileFinder.config_file'
Now that the `ConfigFileFinder` has the `.config_file` attribute, switch the relevant code paths to utilize this public attribute. Tests have been updated to either construct `ConfigFileFinder` or mock the object appropriately.
Diffstat (limited to 'src/flake8')
-rw-r--r--src/flake8/options/config.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/flake8/options/config.py b/src/flake8/options/config.py
index 76a81cf..a4a9783 100644
--- a/src/flake8/options/config.py
+++ b/src/flake8/options/config.py
@@ -317,14 +317,14 @@ class MergedConfigParser(object):
)
return {}
- if cli_config:
+ if self.config_finder.config_file:
LOG.debug(
"Ignoring user and locally found configuration files. "
'Reading only configuration from "%s" specified via '
"--config by the user",
- cli_config,
+ self.config_finder.config_file,
)
- return self.parse_cli_config(cli_config)
+ return self.parse_cli_config(self.config_finder.config_file)
return self.merge_user_and_local_config()
@@ -351,14 +351,14 @@ def get_local_plugins(config_finder, cli_config=None):
)
return local_plugins
- if cli_config:
+ if config_finder.config_file:
LOG.debug(
'Reading local plugins only from "%s" specified via '
"--config by the user",
- cli_config,
+ config_finder.config_file,
)
- config = config_finder.cli_config(cli_config)
- config_files = [cli_config]
+ config = config_finder.cli_config(config_finder.config_file)
+ config_files = [config_finder.config_file]
else:
config, config_files = config_finder.local_configs_with_files()