ignore config files that partially parse as flake8 configs

This commit is contained in:
Anthony Sottile 2022-08-01 19:11:53 -04:00
parent 70c0b3d27a
commit 25e8ff18b3
2 changed files with 4 additions and 2 deletions

View file

@ -29,9 +29,9 @@ def _find_config_file(path: str) -> Optional[str]:
home_stat = None
dir_stat = _stat_key(path)
cfg = configparser.RawConfigParser()
while True:
for candidate in ("setup.cfg", "tox.ini", ".flake8"):
cfg = configparser.RawConfigParser()
cfg_path = os.path.join(path, candidate)
try:
cfg.read(cfg_path, encoding="UTF-8")