From 4c0a32334d9a5b73dcfe3f56868bb933da8e9a3f Mon Sep 17 00:00:00 2001 From: Matus Valo Date: Fri, 14 Apr 2023 21:03:03 +0200 Subject: Disable Info linters in definition instead of Run class (#8576) --- pylint/checkers/misc.py | 1 + pylint/lint/pylinter.py | 31 +++++++++++++++++++++++++------ pylint/lint/run.py | 3 --- pylint/testutils/testing_pylintrc | 4 ++++ 4 files changed, 30 insertions(+), 9 deletions(-) (limited to 'pylint') diff --git a/pylint/checkers/misc.py b/pylint/checkers/misc.py index 89434e759..f81dc43e7 100644 --- a/pylint/checkers/misc.py +++ b/pylint/checkers/misc.py @@ -29,6 +29,7 @@ class ByIdManagedMessagesChecker(BaseRawFileChecker): "%s", "use-symbolic-message-instead", "Used when a message is enabled or disabled by id.", + {"default_enabled": False}, ) } options = () diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py index 104a815cb..a0441e300 100644 --- a/pylint/lint/pylinter.py +++ b/pylint/lint/pylinter.py @@ -138,26 +138,38 @@ MSGS: dict[str, MessageDefinitionTuple] = { "raw-checker-failed", "Used to inform that a built-in module has not been checked " "using the raw checkers.", - {"scope": WarningScope.LINE}, + { + "scope": WarningScope.LINE, + "default_enabled": False, + }, ), "I0010": ( "Unable to consider inline option %r", "bad-inline-option", "Used when an inline option is either badly formatted or can't " "be used inside modules.", - {"scope": WarningScope.LINE}, + { + "scope": WarningScope.LINE, + "default_enabled": False, + }, ), "I0011": ( "Locally disabling %s (%s)", "locally-disabled", "Used when an inline option disables a message or a messages category.", - {"scope": WarningScope.LINE}, + { + "scope": WarningScope.LINE, + "default_enabled": False, + }, ), "I0013": ( "Ignoring entire file", "file-ignored", "Used to inform that the file will not be checked", - {"scope": WarningScope.LINE}, + { + "scope": WarningScope.LINE, + "default_enabled": False, + }, ), "I0020": ( "Suppressed %s (from line %d)", @@ -166,14 +178,20 @@ MSGS: dict[str, MessageDefinitionTuple] = { "by a disable= comment in the file. This message is not " "generated for messages that are ignored due to configuration " "settings.", - {"scope": WarningScope.LINE}, + { + "scope": WarningScope.LINE, + "default_enabled": False, + }, ), "I0021": ( "Useless suppression of %s", "useless-suppression", "Reported when a message is explicitly disabled for a line or " "a block of code, but never triggered.", - {"scope": WarningScope.LINE}, + { + "scope": WarningScope.LINE, + "default_enabled": False, + }, ), "I0022": ( 'Pragma "%s" is deprecated, use "%s" instead', @@ -184,6 +202,7 @@ MSGS: dict[str, MessageDefinitionTuple] = { { "old_names": [("I0014", "deprecated-disable-all")], "scope": WarningScope.LINE, + "default_enabled": False, }, ), "E0001": ( diff --git a/pylint/lint/run.py b/pylint/lint/run.py index b2716cbec..776803f2e 100644 --- a/pylint/lint/run.py +++ b/pylint/lint/run.py @@ -154,9 +154,6 @@ group are mutually exclusive.", # load command line plugins linter.load_plugin_modules(self._plugins) - linter.disable("I") - linter.enable("c-extension-no-member") - # Register the options needed for 'pylint-config' # By not registering them by default they don't show up in the normal usage message if self._is_pylint_config: diff --git a/pylint/testutils/testing_pylintrc b/pylint/testutils/testing_pylintrc index ba5318b51..9429b858f 100644 --- a/pylint/testutils/testing_pylintrc +++ b/pylint/testutils/testing_pylintrc @@ -7,3 +7,7 @@ disable= suppressed-message, locally-disabled, useless-suppression, + +enable= + deprecated-pragma, + use-symbolic-message-instead, -- cgit v1.2.1