summaryrefslogtreecommitdiff
path: root/pylint/config
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2022-06-29 12:49:04 +0200
committerGitHub <noreply@github.com>2022-06-29 12:49:04 +0200
commit63f7c091bef4eca520de9977270e4ff99fd76f9e (patch)
tree6e4cefe5a73cc54c268915f90c1380a8f45e9630 /pylint/config
parent66e12238ca34c666f0ca88cc591c1c4148faedbf (diff)
downloadpylint-git-63f7c091bef4eca520de9977270e4ff99fd76f9e.tar.gz
Fix recognition of config files named ``setup.cfg`` (#3630) (#6577)
Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>
Diffstat (limited to 'pylint/config')
-rw-r--r--pylint/config/config_file_parser.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pylint/config/config_file_parser.py b/pylint/config/config_file_parser.py
index 3d7694956..b6809d984 100644
--- a/pylint/config/config_file_parser.py
+++ b/pylint/config/config_file_parser.py
@@ -42,7 +42,7 @@ class _ConfigurationFileParser:
config_content: dict[str, str] = {}
options: list[str] = []
for section in parser.sections():
- if self._ini_file_with_sections(str(file_path)) and not section.startswith(
+ if self._ini_file_with_sections(file_path) and not section.startswith(
"pylint"
):
if section.lower() == "master":
@@ -61,11 +61,11 @@ class _ConfigurationFileParser:
return config_content, options
@staticmethod
- def _ini_file_with_sections(file_path: str) -> bool:
+ def _ini_file_with_sections(file_path: Path) -> bool:
"""Return whether the file uses sections."""
- if "setup.cfg" in file_path:
+ if "setup.cfg" in file_path.parts:
return True
- if "tox.ini" in file_path:
+ if "tox.ini" in file_path.parts:
return True
return False