From 75580c9530e676841287db719991f687aab4d27e Mon Sep 17 00:00:00 2001 From: Mark Byrne Date: Wed, 12 Jun 2024 23:21:13 +0200 Subject: [PATCH] Identify Pylint configuration in `.ini` and `.cfg` files where the sections are named `[pylint]` or `[pylint.X]`, where `X` is an arbitrary value. --- pylint/config/find_default_config_files.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pylint/config/find_default_config_files.py b/pylint/config/find_default_config_files.py index 8733794a602..03afa89c905 100644 --- a/pylint/config/find_default_config_files.py +++ b/pylint/config/find_default_config_files.py @@ -61,7 +61,10 @@ def _cfg_has_config(path: Path | str) -> bool: parser.read(path, encoding="utf-8") except configparser.Error: return False - return any(section.startswith("pylint.") for section in parser.sections()) + return any( + section == "[pylint]" or section.startswith("pylint.") + for section in parser.sections() + ) def _yield_default_files() -> Iterator[Path]: