diff options
| author | Eric N. Vander Weele <ericvw@gmail.com> | 2019-11-01 21:36:02 -0400 |
|---|---|---|
| committer | Eric N. Vander Weele <ericvw@gmail.com> | 2019-11-03 01:32:38 +0800 |
| commit | 3ac3349ef360e508d553765c19ae9f7b9abc51ed (patch) | |
| tree | 5dcbda4a14c92fb69b219e4d5fa63d2fe46f1d10 /src/flake8/main | |
| parent | b5157e194d89051f39826d28260f1997ec412908 (diff) | |
| download | flake8-3ac3349ef360e508d553765c19ae9f7b9abc51ed.tar.gz | |
application: Simplify creation of configuration file finder
This commit simplifies and updates the method for handling the creation
of the configuration file finder. The main takeaways are:
- Renaming the parameter (i.e., `extra_config_files`) to be a noun to
better describe the input versus what the option name was called.
- Refreshed the docstring to align with changes from previous commits
and this one.
- Remove the check to see if it a configuration file finder was already
created. This is not necessary as each entire run of a `flake8` calls
this method once. When the programmatic API is provided,
configuration would be provided 'in-code' and not rely upon external
files/resources.
- Use directly the program name from the `Application`, itself since
this is the authoritative source for defining it.
Diffstat (limited to 'src/flake8/main')
| -rw-r--r-- | src/flake8/main/application.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/flake8/main/application.py b/src/flake8/main/application.py index 9555202..495cfa8 100644 --- a/src/flake8/main/application.py +++ b/src/flake8/main/application.py @@ -133,17 +133,17 @@ class Application(object): (self.result_count > 0) or self.catastrophic_failure ) - def make_config_finder(self, append_config): + def make_config_finder(self, extra_config_files): # type: (List[str]) -> None - """Make our ConfigFileFinder based on preliminary opts and args. + """Make our ConfigFileFinder based on preliminary options. - :param list append_config: - List of configuration files to be parsed for configuration. + :param list extra_config_files: + List of addtional configuration files to be parsed for + configuration. """ - if self.config_finder is None: - self.config_finder = config.ConfigFileFinder( - self.option_manager.program_name, append_config - ) + self.config_finder = config.ConfigFileFinder( + self.program, extra_config_files + ) def find_plugins(self, config_file, ignore_config_files): # type: (Optional[str], bool) -> None |
