summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric N. Vander Weele <ericvw@gmail.com>2020-01-07 13:14:34 -0500
committerEric N. Vander Weele <ericvw@gmail.com>2020-01-07 13:14:34 -0500
commitc918e7249699ab91ccbd6d69a898d19aa009c971 (patch)
tree258f2692d8a214e48e792cdd72162d464916edc7 /src
parent3d546d448a22b131f42444657f0985b37b252097 (diff)
downloadflake8-c918e7249699ab91ccbd6d69a898d19aa009c971.tar.gz
Remove unused 'isolated' parameter
Now that `ConfigFileFinder.ignore_config_files` attribute is used everywhere and is constructed from the `--isolated` CLI option, the now unused `isolated` parameters can be safely removed.
Diffstat (limited to 'src')
-rw-r--r--src/flake8/api/legacy.py13
-rw-r--r--src/flake8/main/application.py27
-rw-r--r--src/flake8/options/aggregator.py6
-rw-r--r--src/flake8/options/config.py10
4 files changed, 14 insertions, 42 deletions
diff --git a/src/flake8/api/legacy.py b/src/flake8/api/legacy.py
index fe3b405..40da7db 100644
--- a/src/flake8/api/legacy.py
+++ b/src/flake8/api/legacy.py
@@ -32,18 +32,15 @@ def get_style_guide(**kwargs):
prelim_opts, remaining_args = application.parse_preliminary_options([])
flake8.configure_logging(prelim_opts.verbose, prelim_opts.output_file)
config_finder = config.ConfigFileFinder(
- application.program, prelim_opts.append_config
+ application.program,
+ prelim_opts.append_config,
+ ignore_config_files=prelim_opts.isolated,
)
- application.find_plugins(
- config_finder, prelim_opts.config, prelim_opts.isolated
- )
+ application.find_plugins(config_finder, prelim_opts.config)
application.register_plugin_options()
application.parse_configuration_and_cli(
- config_finder,
- prelim_opts.config,
- prelim_opts.isolated,
- remaining_args,
+ config_finder, prelim_opts.config, remaining_args,
)
# We basically want application.initialize to be called but with these
# options set instead before we make our formatter, notifier, internal
diff --git a/src/flake8/main/application.py b/src/flake8/main/application.py
index 7ea3fbb..a30f195 100644
--- a/src/flake8/main/application.py
+++ b/src/flake8/main/application.py
@@ -131,8 +131,8 @@ class Application(object):
(self.result_count > 0) or self.catastrophic_failure
)
- def find_plugins(self, config_finder, config_file, ignore_config_files):
- # type: (config.ConfigFileFinder, Optional[str], bool) -> None
+ def find_plugins(self, config_finder, config_file):
+ # type: (config.ConfigFileFinder, Optional[str]) -> None
"""Find and load the plugins for this application.
Set the :attr:`check_plugins` and :attr:`formatting_plugins` attributes
@@ -147,9 +147,7 @@ class Application(object):
Determine whether to parse configuration files or not. (i.e., the
--isolated option).
"""
- local_plugins = config.get_local_plugins(
- config_finder, config_file, ignore_config_files
- )
+ local_plugins = config.get_local_plugins(config_finder, config_file)
sys.path.extend(local_plugins.paths)
@@ -173,7 +171,6 @@ class Application(object):
self,
config_finder, # type: config.ConfigFileFinder
config_file, # type: Optional[str]
- ignore_config_files, # type: bool
argv, # type: List[str]
):
# type: (...) -> None
@@ -184,18 +181,11 @@ class Application(object):
:param str config_file:
The optional configuraiton file to override all other configuration
files (i.e., the --config option).
- :param bool ignore_config_files:
- Determine whether to parse configuration files or not. (i.e., the
- --isolated option).
:param list argv:
Command-line arguments passed in directly.
"""
self.options, self.args = aggregator.aggregate_options(
- self.option_manager,
- config_finder,
- config_file,
- ignore_config_files,
- argv,
+ self.option_manager, config_finder, config_file, argv,
)
self.running_against_diff = self.options.diff
@@ -339,15 +329,10 @@ class Application(object):
prelim_opts.append_config,
ignore_config_files=prelim_opts.isolated,
)
- self.find_plugins(
- config_finder, prelim_opts.config, prelim_opts.isolated
- )
+ self.find_plugins(config_finder, prelim_opts.config)
self.register_plugin_options()
self.parse_configuration_and_cli(
- config_finder,
- prelim_opts.config,
- prelim_opts.isolated,
- remaining_args,
+ config_finder, prelim_opts.config, remaining_args,
)
self.make_formatter()
self.make_guide()
diff --git a/src/flake8/options/aggregator.py b/src/flake8/options/aggregator.py
index 58d1022..939dfb3 100644
--- a/src/flake8/options/aggregator.py
+++ b/src/flake8/options/aggregator.py
@@ -17,7 +17,6 @@ def aggregate_options(
manager, # type: OptionManager
config_finder, # type: config.ConfigFileFinder
cli_config, # type: Optional[str]
- isolated, # type: bool
argv, # type: List[str]
): # type: (...) -> Tuple[argparse.Namespace, List[str]]
"""Aggregate and merge CLI and config file options.
@@ -29,9 +28,6 @@ def aggregate_options(
:param str cli_config:
Value of --config when specified at the command-line. Overrides
all other config files.
- :param bool isolated:
- Determines if we should parse configuration files at all or not.
- If running in isolated mode, we ignore all configuration files
:param list argv:
The list of remaining command-line argumentsthat were unknown during
preliminary option parsing to pass to ``manager.parse_args``.
@@ -50,7 +46,7 @@ def aggregate_options(
)
# Get the parsed config
- parsed_config = config_parser.parse(cli_config, isolated)
+ parsed_config = config_parser.parse(cli_config)
# Extend the default ignore value with the extended default ignore list,
# registered by plugins.
diff --git a/src/flake8/options/config.py b/src/flake8/options/config.py
index ead12dc..7261bcd 100644
--- a/src/flake8/options/config.py
+++ b/src/flake8/options/config.py
@@ -289,7 +289,7 @@ class MergedConfigParser(object):
return config
- def parse(self, cli_config=None, isolated=False):
+ def parse(self, cli_config=None):
"""Parse and return the local and user config files.
First this copies over the parsed local configuration and then
@@ -299,9 +299,6 @@ class MergedConfigParser(object):
:param str cli_config:
Value of --config when specified at the command-line. Overrides
all other config files.
- :param bool isolated:
- Determines if we should parse configuration files at all or not.
- If running in isolated mode, we ignore all configuration files
:returns:
Dictionary of parsed configuration options
:rtype:
@@ -326,7 +323,7 @@ class MergedConfigParser(object):
return self.merge_user_and_local_config()
-def get_local_plugins(config_finder, cli_config=None, isolated=False):
+def get_local_plugins(config_finder, cli_config=None):
"""Get local plugins lists from config files.
:param flake8.options.config.ConfigFileFinder config_finder:
@@ -334,9 +331,6 @@ def get_local_plugins(config_finder, cli_config=None, isolated=False):
:param str cli_config:
Value of --config when specified at the command-line. Overrides
all other config files.
- :param bool isolated:
- Determines if we should parse configuration files at all or not.
- If running in isolated mode, we ignore all configuration files
:returns:
LocalPlugins namedtuple containing two lists of plugin strings,
one for extension (checker) plugins and one for report plugins.