mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-04 20:26:53 +00:00
config: Remove ConfigFileFinder 'parent' and 'tail' attributes
These attributes are only needed within the `.generate_possible_local_files()` method. Therefore, just obtain the current working directory at the beginning of the method and reduce the lifetime state of the `ConfigFileFinder` object.
This commit is contained in:
parent
98d3d50295
commit
e887ef3317
2 changed files with 6 additions and 8 deletions
|
|
@ -51,8 +51,6 @@ class ConfigFileFinder(object):
|
|||
|
||||
self.local_directory = os.path.abspath(os.curdir)
|
||||
|
||||
self.parent = self.tail = os.getcwd()
|
||||
|
||||
# caches to avoid double-reading config files
|
||||
self._local_configs = None
|
||||
self._local_found_files = [] # type: List[str]
|
||||
|
|
@ -96,8 +94,7 @@ class ConfigFileFinder(object):
|
|||
|
||||
def generate_possible_local_files(self):
|
||||
"""Find and generate all local config files."""
|
||||
tail = self.tail
|
||||
parent = self.parent
|
||||
parent = tail = os.getcwd()
|
||||
found_config_files = False
|
||||
while tail and not found_config_files:
|
||||
for project_filename in self.project_filenames:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue