-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
False-positive I0021: Useless suppression of 'line-too-long' (useless-suppression) #4212
Comments
I can reproduce this, thank you. |
Here's another example: """False-positive ungrouped-imports or useless-suppression."""
from re import sub
if 2 > 1:
from pathlib import Path
if 3 > 1:
from re import match # pylint:disable=ungrouped-imports
print(Path(), sub("", "", ""), match("", "")) Assuming that |
Hi @bersbersbers in your example the import are grouped each in their own scope (isort would not change the file) so there should not be an ungrouped-imports and the useles suppression is not a false positive. |
Another example I just encountered in astroid:
# pylint: disable=unused-variable; doesn't understand singledispatch
@_repr_tree.register(NodeNG)
def _repr_node(node, result, done, cur_indent="", depth=1):
"""Outputs a strings representation of an astroid node.""" If you remove the disable you then get |
Also changes ``add_ignored_message()`` to make ``nodes`` parameter optional. Closes pylint-dev#4212
Also changes ``add_ignored_message()`` to make ``nodes`` parameter optional. Closes pylint-dev#4212
This is a different issue and a different issue should be opened to track it. If you can give me a minimal working example to include in the tests I can work on fixing the false positive! |
Also changes ``add_ignored_message()`` to make ``nodes`` parameter optional. Closes #4212 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Steps to reproduce
Given a file
a.py
:Current behavior
Result of
pylint --enable=useless-suppression a.py
:Expected behavior
No output.
pylint --version output
Result of
pylint --version
output:The text was updated successfully, but these errors were encountered: