Skip to content

Commit

Permalink
Rename the function to be more explicit.
Browse files Browse the repository at this point in the history
Co-authored-by: Daniël van Noord <[email protected]>
  • Loading branch information
mbyrnepr2 and DanielNoord committed Jun 17, 2024
1 parent 99195b4 commit 9e597be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pylint/config/find_default_config_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _toml_has_config(path: Path | str) -> bool:
return "pylint" in content.get("tool", [])


def _cfg_has_config(path: Path | str) -> bool:
def _cfg_or_ini_has_config(path: Path | str) -> bool:
parser = configparser.ConfigParser()
try:
parser.read(path, encoding="utf-8")
Expand All @@ -74,7 +74,7 @@ def _yield_default_files() -> Iterator[Path]:
if config_name.is_file():
if config_name.suffix == ".toml" and not _toml_has_config(config_name):
continue
if config_name.suffix in {".cfg", ".ini"} and not _cfg_has_config(
if config_name.suffix in {".cfg", ".ini"} and not _cfg_or_ini_has_config(
config_name
):
continue
Expand Down
4 changes: 2 additions & 2 deletions tests/config/test_find_default_config_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from pytest import CaptureFixture

from pylint import config, testutils
from pylint.config.find_default_config_files import _cfg_has_config, _toml_has_config
from pylint.config.find_default_config_files import _cfg_or_ini_has_config, _toml_has_config
from pylint.lint.run import Run


Expand Down Expand Up @@ -313,7 +313,7 @@ def test_has_config(content: str, expected: bool, tmp_path: Path) -> None:
fake_conf = tmp_path / file_name
with open(fake_conf, "w", encoding="utf8") as f:
f.write(content)
assert _cfg_has_config(fake_conf) == expected
assert _cfg_or_ini_has_config(fake_conf) == expected


def test_non_existent_home() -> None:
Expand Down

0 comments on commit 9e597be

Please sign in to comment.