mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-29 10:36:53 +00:00
Fix config file search.
Before this fix, it would recurse upwards, stopping if new_path was equal to home_path *before* actually checking home_path. Now it recurses up to *and including* home_path.
This commit is contained in:
parent
2b3d18f0e9
commit
299aa3e9ed
1 changed files with 5 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
"""Config handling logic for Flake8."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import configparser
|
||||
|
|
@ -41,9 +42,12 @@ def _find_config_file(path: str) -> str | None:
|
|||
if "flake8" in cfg or "flake8:local-plugins" in cfg:
|
||||
return cfg_path
|
||||
|
||||
if dir_stat == home_stat:
|
||||
break
|
||||
|
||||
new_path = os.path.dirname(path)
|
||||
new_dir_stat = _stat_key(new_path)
|
||||
if new_dir_stat == dir_stat or new_dir_stat == home_stat:
|
||||
if new_dir_stat == dir_stat:
|
||||
break
|
||||
else:
|
||||
path = new_path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue