diff options
| author | Eric N. Vander Weele <ericvw@gmail.com> | 2020-01-12 16:03:03 -0800 |
|---|---|---|
| committer | Eric N. Vander Weele <ericvw@gmail.com> | 2020-01-12 23:28:52 -0500 |
| commit | eb6698c420bc62e4069377f8112c96893d30dd85 (patch) | |
| tree | b78f9607faac7419731829536970f402b7405ce2 /src/flake8/options | |
| parent | 44d67e46f5ebe6bc458fe7b18a7b8821e7b2391e (diff) | |
| download | flake8-eb6698c420bc62e4069377f8112c96893d30dd85.tar.gz | |
config: Make ConfigFileFinder 'extra_config_files' parameter optional
This simplifies the number of required parameters needed for the
`ConfigFileFinder` object throughout the various tests.
Diffstat (limited to 'src/flake8/options')
| -rw-r--r-- | src/flake8/options/config.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/flake8/options/config.py b/src/flake8/options/config.py index af163ca..ed8c096 100644 --- a/src/flake8/options/config.py +++ b/src/flake8/options/config.py @@ -19,11 +19,11 @@ class ConfigFileFinder(object): def __init__( self, program_name, - extra_config_files, + extra_config_files=None, config_file=None, ignore_config_files=False, ): - # type: (str, List[str], Optional[str], bool) -> None + # type: (str, Optional[List[str]], Optional[str], bool) -> None """Initialize object to find config files. :param str program_name: @@ -36,7 +36,8 @@ class ConfigFileFinder(object): Determine whether to ignore configuration files or not. """ # The values of --append-config from the CLI - extra_config_files = extra_config_files or [] + if extra_config_files is None: + extra_config_files = [] self.extra_config_files = utils.normalize_paths(extra_config_files) # The value of --config from the CLI. |
