diff options
| author | Anthony Sottile <asottile@umich.edu> | 2019-11-06 04:35:22 +0000 |
|---|---|---|
| committer | Anthony Sottile <asottile@umich.edu> | 2019-11-06 04:35:22 +0000 |
| commit | e653ab80627dea38e785ea059b6fe42595a4ce81 (patch) | |
| tree | 3a85b52e0451d2b179b7a3a6271dc58ac6ad7f3e /src/flake8/main | |
| parent | 034f8823bc8bf853b8f75ada9bc39230c6fe49a7 (diff) | |
| parent | d75088b199d92f12c1881b871d826c4de8734ae0 (diff) | |
| download | flake8-e653ab80627dea38e785ea059b6fe42595a4ce81.tar.gz | |
Merge branch 'app-make-config-side-effect-free' into 'master'
application: Change `make_config_finder` to be a pure static method
See merge request pycqa/flake8!378
Diffstat (limited to 'src/flake8/main')
| -rw-r--r-- | src/flake8/main/application.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/flake8/main/application.py b/src/flake8/main/application.py index 40e196c..a317144 100644 --- a/src/flake8/main/application.py +++ b/src/flake8/main/application.py @@ -133,17 +133,22 @@ class Application(object): (self.result_count > 0) or self.catastrophic_failure ) - def make_config_finder(self, extra_config_files): - # type: (List[str]) -> None + @staticmethod + def make_config_finder(program_name, extra_config_files): + # type: (str, List[str]) -> config.ConfigFileFinder """Make our ConfigFileFinder based on preliminary options. + :param str program_name: + Name of the current programin (e.g., flake8). :param list extra_config_files: List of addtional configuration files to be parsed for configuration. + :returns: + The configuration file finder + :rtype: + config.ConfigFileFinder """ - self.config_finder = config.ConfigFileFinder( - self.program, extra_config_files - ) + return config.ConfigFileFinder(program_name, extra_config_files) def find_plugins(self, config_file, ignore_config_files): # type: (Optional[str], bool) -> None @@ -333,7 +338,9 @@ class Application(object): # our legacy API calls to these same methods. prelim_opts, remaining_args = self.parse_preliminary_options(argv) flake8.configure_logging(prelim_opts.verbose, prelim_opts.output_file) - self.make_config_finder(prelim_opts.append_config) + self.config_finder = self.make_config_finder( + self.program, prelim_opts.append_config + ) self.find_plugins(prelim_opts.config, prelim_opts.isolated) self.register_plugin_options() self.parse_configuration_and_cli(remaining_args) |
