From 33ceaba81b723a6d8466b94167c823fe82fdc080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sat, 2 Jul 2022 14:06:10 +0200 Subject: [PATCH] Add default for the disable option --- doc/whatsnew/2/2.15/index.rst | 16 ++++++++++++++++ pylint/lint/base_options.py | 21 ++++++++++++++++++++- pylintrc | 1 - 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/doc/whatsnew/2/2.15/index.rst b/doc/whatsnew/2/2.15/index.rst index dc358063f4..6984ca13d5 100644 --- a/doc/whatsnew/2/2.15/index.rst +++ b/doc/whatsnew/2/2.15/index.rst @@ -11,6 +11,7 @@ Summary -- Release highlights ============================= +Stub: Include information about the new default values of ``disable``. This can potentially break CIs. New checkers ============ @@ -23,6 +24,21 @@ Removed checkers ================ +Configuration +================ + +* We have added a new default value for the ``disable`` option. By default the following messages are now disabled: + ``missing-module-docstring``, ``missing-class-docstring``, ``missing-function-docstring``, + ``too-many-ancestors``, ``too-many-instance-attributes``, ``too-few-public-methods``, + ``too-many-public-methods``, ``too-many-return-statements``, ``too-many-branches``, + ``too-many-arguments``, ``too-many-locals``, ``too-many-statements``, ``too-many-boolean-expressions``, + ``too-many-nested-blocks``, ``bad-classmethod-argument``, ``bad-mcs-classmethod-argument``, + ``duplicate-code``, ``fixme``. + Previously no messages were disabled by default. That behaviour can be reinstated by adding ``disable =`` to + the configuration file. + + Closes #3512 + Extensions ========== diff --git a/pylint/lint/base_options.py b/pylint/lint/base_options.py index 3ee0d5238f..9222e28f49 100644 --- a/pylint/lint/base_options.py +++ b/pylint/lint/base_options.py @@ -204,7 +204,26 @@ def _make_linter_options(linter: PyLinter) -> Options: "action": _DisableAction, "callback": lambda x1, x2, x3, x4: x1, "metavar": "", - "default": (), + "default": ( + "missing-module-docstring", + "missing-class-docstring", + "missing-function-docstring", + "too-many-ancestors", + "too-many-instance-attributes", + "too-few-public-methods", + "too-many-public-methods", + "too-many-return-statements", + "too-many-branches", + "too-many-arguments", + "too-many-locals", + "too-many-statements", + "too-many-boolean-expressions", + "too-many-nested-blocks", + "bad-classmethod-argument", + "bad-mcs-classmethod-argument", + "duplicate-code", + "fixme", + ), "short": "d", "group": "Messages control", "help": "Disable the message, report, category or checker " diff --git a/pylintrc b/pylintrc index 5e7a6193e7..c8191bc306 100644 --- a/pylintrc +++ b/pylintrc @@ -102,7 +102,6 @@ disable= too-few-public-methods, # handled by black format, - # We anticipate #3512 where it will become optional fixme,