Open martimlobao opened 4 years ago
I can confirm the bug, thanks for reporting.
If the fix isn't too complicated, I'd be happy to have a go. I just need some general direction of where to look.
I am seeing the same thing for specific docstring checks that were disabled in the .pylintrc
file (using 2.5.3). I assume this is the same issue:
# pylint: enable=missing-docstring
Can still reproduce this today.
This requires a complete overhaul of the way we enable and disable messages. The issue is that we disable certain checkers and methods based on whether they are going to be called. In this specific example we disable the complete DocstringChecker
and all of its methods as the messages the checker emits are all disabled.
Changing this part of the code to be context aware would require a major overhaul and might nog even be feasible.
Steps to reproduce
.pylintrc
file:test.py
file:import json
def test(foo = "bar"): return foo
$ pylint test.py ***** Module test test.py:3:0: W0611: Unused import json (unused-import)
Your code has been rated at 6.67/10 (previous run: 6.67/10, +0.00)
$ pylint test.py ***** Module test test.py:5:13: C0326: No space allowed around keyword argument assignment def test(foo = "bar"): ^ (bad-whitespace) test.py:1:0: C0111: Missing module docstring (missing-docstring) test.py:5:0: C0102: Black listed name "foo" (blacklisted-name) test.py:5:0: C0111: Missing function docstring (missing-docstring) test.py:3:0: W0611: Unused import json (unused-import)
Your code has been rated at -6.67/10 (previous run: 6.67/10, -13.33)
$ pylint --version pylint 2.4.4 astroid 2.3.3 Python 3.7.4 (default, Jul 25 2019, 00:08:15) [Clang 11.0.0 (clang-1100.0.20.17)]