Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default for the disable option #7111

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions doc/whatsnew/2/2.15/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Summary -- Release highlights
=============================

Stub: Include information about the new default values of ``disable``. This can potentially break CIs.

New checkers
============
Expand All @@ -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
==========

Expand Down
21 changes: 20 additions & 1 deletion pylint/lint/base_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,26 @@ def _make_linter_options(linter: PyLinter) -> Options:
"action": _DisableAction,
"callback": lambda x1, x2, x3, x4: x1,
"metavar": "<msg ids>",
"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 "
Expand Down
1 change: 0 additions & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ disable=
too-few-public-methods,
# handled by black
format,
# We anticipate #3512 where it will become optional
fixme,


Expand Down