summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Finkler <3929834+DudeNr33@users.noreply.github.com>2022-05-15 09:01:11 +0200
committerGitHub <noreply@github.com>2022-05-15 09:01:11 +0200
commit3e643a0b3ad0d019a6ca9395e4ca377efd60c63d (patch)
tree20580bc32b8e7489aa1a39aed7437e0f174b0444
parentc6d5cfef4f5359dea1e2558c18e6792d6d726edf (diff)
downloadpylint-git-3e643a0b3ad0d019a6ca9395e4ca377efd60c63d.tar.gz
Create constant for default ignore list (#6615)
-rw-r--r--pylint/constants.py2
-rw-r--r--pylint/lint/base_options.py4
-rw-r--r--pylint/pyreverse/inspector.py3
-rw-r--r--pylint/pyreverse/main.py3
4 files changed, 8 insertions, 4 deletions
diff --git a/pylint/constants.py b/pylint/constants.py
index 2a6276ff3..6993b400c 100644
--- a/pylint/constants.py
+++ b/pylint/constants.py
@@ -54,6 +54,8 @@ USER_HOME = os.path.expanduser("~")
OLD_DEFAULT_PYLINT_HOME = ".pylint.d"
DEFAULT_PYLINT_HOME = platformdirs.user_cache_dir("pylint")
+DEFAULT_IGNORE_LIST = ("CVS",)
+
class WarningScope:
LINE = "line-based-msg"
diff --git a/pylint/lint/base_options.py b/pylint/lint/base_options.py
index a25827b2b..aab019044 100644
--- a/pylint/lint/base_options.py
+++ b/pylint/lint/base_options.py
@@ -10,7 +10,7 @@ import re
import sys
from typing import TYPE_CHECKING
-from pylint import interfaces
+from pylint import constants, interfaces
from pylint.config.callback_actions import (
_DisableAction,
_DoNothingAction,
@@ -44,7 +44,7 @@ def _make_linter_options(linter: PyLinter) -> Options:
"metavar": "<file>[,<file>...]",
"dest": "black_list",
"kwargs": {"old_names": ["black_list"]},
- "default": ("CVS",),
+ "default": constants.DEFAULT_IGNORE_LIST,
"help": "Files or directories to be skipped. "
"They should be base names, not paths.",
},
diff --git a/pylint/pyreverse/inspector.py b/pylint/pyreverse/inspector.py
index afd55c0a6..01f720874 100644
--- a/pylint/pyreverse/inspector.py
+++ b/pylint/pyreverse/inspector.py
@@ -18,6 +18,7 @@ from typing import Any, Callable, Optional
import astroid
from astroid import nodes
+from pylint import constants
from pylint.pyreverse import utils
_WrapperFuncT = Callable[[Callable[[str], nodes.Module], str], Optional[nodes.Module]]
@@ -322,7 +323,7 @@ def project_from_files(
files: list[str],
func_wrapper: _WrapperFuncT = _astroid_wrapper,
project_name: str = "no name",
- black_list: tuple[str, ...] = ("CVS",),
+ black_list: tuple[str, ...] = constants.DEFAULT_IGNORE_LIST,
) -> Project:
"""Return a Project from a list of files or modules."""
# build the project representation
diff --git a/pylint/pyreverse/main.py b/pylint/pyreverse/main.py
index 0dc731618..8584bc698 100644
--- a/pylint/pyreverse/main.py
+++ b/pylint/pyreverse/main.py
@@ -10,6 +10,7 @@ import sys
from collections.abc import Sequence
from typing import NoReturn
+from pylint import constants
from pylint.config.arguments_manager import _ArgumentsManager
from pylint.config.arguments_provider import _ArgumentsProvider
from pylint.lint.utils import fix_import_path
@@ -175,7 +176,7 @@ OPTIONS: Options = (
type="csv",
metavar="<file[,file...]>",
dest="ignore_list",
- default=("CVS",),
+ default=constants.DEFAULT_IGNORE_LIST,
help="Files or directories to be skipped. They should be base names, not paths.",
),
),