Skip to content

Commit

Permalink
pylint: Enable useless-suppression
Browse files Browse the repository at this point in the history
https://pylint.pycqa.org/en/latest/user_guide/message-control.html#detecting-useless-disables:

> As pylint gets better and false positives are removed, disables that
  became useless can accumulate and clutter the code. In order to clean
  them you can enable the useless-suppression warning.

This doesn't enforce useless-suppression warnings as errors. The idea is
cleanup of these warings on every Pylint's bump.

Fixes: freeipa/freeipa-healthcheck#244
Signed-off-by: Stanislav Levin <[email protected]>
  • Loading branch information
joeldavidparker committed Mar 24, 2022
1 parent 98619b7 commit abe2fd0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 10 additions & 2 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,18 @@ valid-metaclass-classmethod-first-arg=cls

enable=
all,
python3
python3,
useless-suppression,

disable=
I,
bad-inline-option,
c-extension-no-member,
deprecated-pragma,
file-ignored,
locally-disabled,
raw-checker-failed,
suppressed-message,
use-symbolic-message-instead,
duplicate-code,
interface-not-implemented,
no-self-use,
Expand Down
8 changes: 4 additions & 4 deletions tests/test_ipa_dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def query_uri(hosts):
if version.MAJOR < 2 or (version.MAJOR == 2 and version.MINOR == 0):
m = message.Message()
elif version.MAJOR == 2 and version.MINOR > 0:
m = message.QueryMessage() # pylint: disable=E1101
m = message.make_response(m) # pylint: disable=E1101
m = message.QueryMessage()
m = message.make_response(m)

rdtype = rdatatype.URI
for name in ('_kerberos.', '_kpasswd.'):
Expand Down Expand Up @@ -158,8 +158,8 @@ def fake_query(qname, rdtype=rdatatype.A, rdclass=rdataclass.IN, count=1,
if version.MAJOR < 2 or (version.MAJOR == 2 and version.MINOR == 0):
m = message.Message()
elif version.MAJOR == 2 and version.MINOR > 0:
m = message.QueryMessage() # pylint: disable=E1101
m = message.make_response(m) # pylint: disable=E1101
m = message.QueryMessage()
m = message.make_response(m)
if rdtype in (rdatatype.A, rdatatype.AAAA):
fqdn = DNSName(qname)
fqdn = fqdn.make_absolute()
Expand Down

0 comments on commit abe2fd0

Please sign in to comment.