Skip to content
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ debian/pylint
.eggs/
.pytest_cache/
.mypy_cache/
.vscode
Comment thread
danrneal marked this conversation as resolved.
venv/
9 changes: 6 additions & 3 deletions doc/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,12 @@ tricks like: ::

pylint does have some messages disabled by default, either because
they are prone to false positives or that they are opinionated enough
for not being included as default messages. But most of the disabled
messages are from the Python 3 porting checker, which is disabled by
default. It needs special activation with the ``--py3k`` flag.
for not being included as default messages. The disabled messages are
from the Python 3 porting checker and design checker, which are disabled
by default. The Python 3 porting checker needs special activation with
the ``--py3k`` flag. The design checker can be enabled with
``--enabled=design``.


4.8 I am using another popular linter alongside pylint. Which messages should I disable to avoid duplicates?
------------------------------------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions doc/whatsnew/2.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ Other Changes
* Fix bug that lead to duplicate messages when using ``--jobs 2`` or more.

Close #3584

* The `design` checker has been disabled by default, users can still explicitly enable the checker by specifying ``--enabled=design`` at the command line or including ``enable=design`` under the "MESSAGES CONTROL" section in their config files.
1 change: 1 addition & 0 deletions pylint/checkers/design_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class MisdesignChecker(BaseChecker):
"""

__implements__ = (IAstroidChecker,)
enabled = False

# configuration section name
name = "design"
Expand Down
1 change: 1 addition & 0 deletions pylint/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ def __init__(self, test_file):
self._linter.set_reporter(_test_reporter)
self._linter.config.persistent = 0
checkers.initialize(self._linter)
self._linter.enable("design")
self._linter.disable("I")
try:
self._linter.read_config_file(test_file.option_file)
Expand Down
9 changes: 9 additions & 0 deletions tests/lint/unittest_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,15 @@ def test_python3_checker_disabled(linter):
assert "python3" in checker_names


def test_design_checker_disabled(linter):
checker_names = [c.name for c in linter.prepare_checkers()]
assert "design" not in checker_names

linter.set_option("enable", "design")
checker_names = [c.name for c in linter.prepare_checkers()]
assert "design" in checker_names


def test_full_documentation(linter):
out = StringIO()
linter.print_full_documentation(out)
Expand Down
1 change: 1 addition & 0 deletions tests/test_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def _check_result(self, got):
assert self._get_expected().strip() + "\n" == got.strip() + "\n"

def _test(self, tocheck):
self.linter.enable("design")
if INFO_TEST_RGX.match(self.module):
self.linter.enable("I")
else:
Expand Down