summaryrefslogtreecommitdiff
path: root/pylint/config/find_default_config_files.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/config/find_default_config_files.py')
-rw-r--r--pylint/config/find_default_config_files.py25
1 files changed, 3 insertions, 22 deletions
diff --git a/pylint/config/find_default_config_files.py b/pylint/config/find_default_config_files.py
index 43e682a58..a121b32a3 100644
--- a/pylint/config/find_default_config_files.py
+++ b/pylint/config/find_default_config_files.py
@@ -1,13 +1,12 @@
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
-# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
+# For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE
+# Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt
from __future__ import annotations
import configparser
import os
import sys
-import warnings
from collections.abc import Iterator
from pathlib import Path
@@ -17,7 +16,7 @@ else:
import tomli as tomllib
RC_NAMES = (Path("pylintrc"), Path(".pylintrc"))
-CONFIG_NAMES = RC_NAMES + (Path("pyproject.toml"), Path("setup.cfg"))
+CONFIG_NAMES = (*RC_NAMES, Path("pyproject.toml"), Path("setup.cfg"))
def _toml_has_config(path: Path | str) -> bool:
@@ -110,21 +109,3 @@ def find_default_config_files() -> Iterator[Path]:
yield Path("/etc/pylintrc").resolve()
except OSError:
pass
-
-
-def find_pylintrc() -> str | None:
- """Search the pylint rc file and return its path if it finds it, else return
- None.
- """
- # TODO: 3.0: Remove deprecated function
- warnings.warn(
- "find_pylintrc and the PYLINTRC constant have been deprecated. "
- "Use find_default_config_files if you want access to pylint's configuration file "
- "finding logic.",
- DeprecationWarning,
- stacklevel=2,
- )
- for config_file in find_default_config_files():
- if str(config_file).endswith("pylintrc"):
- return str(config_file)
- return None