mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-06 13:06:53 +00:00
Make it easy for third party patch to support pyproject.toml
This commit is contained in:
parent
7a6c42fc43
commit
2ddb431912
1 changed files with 3 additions and 1 deletions
|
|
@ -11,6 +11,8 @@ from flake8.options.manager import OptionManager
|
|||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
CONFIG_FILES = ("setup.cfg", "tox.ini", ".flake8")
|
||||
|
||||
|
||||
def _stat_key(s: str) -> tuple[int, int]:
|
||||
# same as what's used by samefile / samestat
|
||||
|
|
@ -28,7 +30,7 @@ def _find_config_file(path: str) -> str | None:
|
|||
|
||||
dir_stat = _stat_key(path)
|
||||
while True:
|
||||
for candidate in ("setup.cfg", "tox.ini", ".flake8"):
|
||||
for candidate in CONFIG_FILES:
|
||||
cfg = configparser.RawConfigParser()
|
||||
cfg_path = os.path.join(path, candidate)
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue