application: Remove forwarding unused preliminary arguments

The `ConfigFileFinder` doesn't utilize the preliminary arguments (i.e.,
the file names) anymore for computing the starting path for the
configuration file search.
This commit is contained in:
Eric N. Vander Weele 2019-10-12 22:50:46 +01:00
parent 3f1bdc74a9
commit 66f832d291
3 changed files with 5 additions and 7 deletions

View file

@ -32,7 +32,7 @@ def get_style_guide(**kwargs):
[]
)
flake8.configure_logging(prelim_opts.verbose, prelim_opts.output_file)
application.make_config_finder(prelim_opts.append_config, prelim_args)
application.make_config_finder(prelim_opts.append_config)
application.find_plugins(prelim_opts.config, prelim_opts.isolated)
application.register_plugin_options()
application.parse_configuration_and_cli([])

View file

@ -152,14 +152,12 @@ class Application(object):
(self.result_count > 0) or self.catastrophic_failure
)
def make_config_finder(self, append_config, args):
# type: (List[str], List[str]) -> None
def make_config_finder(self, append_config):
# type: (List[str]) -> None
"""Make our ConfigFileFinder based on preliminary opts and args.
:param list append_config:
List of configuration files to be parsed for configuration.
:param list args:
The list of file arguments passed from the CLI.
"""
if self.config_finder is None:
self.config_finder = config.ConfigFileFinder(
@ -363,7 +361,7 @@ class Application(object):
argv
)
flake8.configure_logging(prelim_opts.verbose, prelim_opts.output_file)
self.make_config_finder(prelim_opts.append_config, prelim_args)
self.make_config_finder(prelim_opts.append_config)
self.find_plugins(prelim_opts.config, prelim_opts.isolated)
self.register_plugin_options()
self.parse_configuration_and_cli(argv)

View file

@ -28,7 +28,7 @@ def test_get_style_guide():
application.assert_called_once_with()
mockedapp.parse_preliminary_options_and_args.assert_called_once_with([])
mockedapp.make_config_finder.assert_called_once_with([], [])
mockedapp.make_config_finder.assert_called_once_with([])
mockedapp.find_plugins.assert_called_once_with(None, False)
mockedapp.register_plugin_options.assert_called_once_with()
mockedapp.parse_configuration_and_cli.assert_called_once_with([])