Skip to content

Commit

Permalink
Replaced deprecated find_pylintrc by find_default_config_files (#643)
Browse files Browse the repository at this point in the history
Inspired by https://github.com/spyder-ide/spyder/pull/21470/files

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
  • Loading branch information
perestoronin and Pierre-Sassoulas authored Oct 3, 2024
1 parent 597d191 commit e614c51
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions prospector/tools/pylint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pathlib import Path
from typing import List

from pylint.config import find_pylintrc
from pylint.config import find_default_config_files
from pylint.exceptions import UnknownMessageError
from pylint.lint.run import _cpu_count

Expand Down Expand Up @@ -177,7 +177,14 @@ def _get_pylint_configuration(
# try to find a .pylintrc
pylintrc = pylint_options.get("config_file")
external_config = prospector_config.external_config_location("pylint")
pylintrc = pylintrc or external_config or find_pylintrc()

pylintrc = pylintrc or external_config

if pylintrc is None:
for p in find_default_config_files():
pylintrc = str(p)
break

if pylintrc is None: # nothing explicitly configured
for possible in (".pylintrc", "pylintrc", "pyproject.toml", "setup.cfg"):
pylintrc_path = os.path.join(prospector_config.workdir, possible)
Expand Down

0 comments on commit e614c51

Please sign in to comment.