Module: check_mk
Branch: master
Commit: 96669cde6be8d87143965e7aa82373f51080524d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=96669cde6be8d8…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Jul 23 15:41:12 2018 +0200
Fixed a few unused-import warnings and classified the warning.
Change-Id: I4644104434b67631fc215dc1181a1f09239ff4c7
---
cmk_base/check_api.py | 4 ++--
tests/pylint/pylintrc | 5 ++++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/cmk_base/check_api.py b/cmk_base/check_api.py
index 381849c..3164fcb 100644
--- a/cmk_base/check_api.py
+++ b/cmk_base/check_api.py
@@ -96,7 +96,6 @@ from cmk.exceptions import MKGeneralException
# with an underscore. These names will be skipped when loading into the
# check context.
import cmk_base.utils as _utils
-import cmk_base.console as _console
import cmk_base.config as _config
import cmk.defines as _defines
import cmk_base.snmp_utils as _snmp_utils
@@ -130,7 +129,8 @@ import socket
import sys
import os
import time
-import pprint
+# NOTE: We do not use pprint in this module, but it is part of the check API.
+import pprint # pylint: disable=unused-import
from cmk.regex import regex
import cmk.render as render
diff --git a/tests/pylint/pylintrc b/tests/pylint/pylintrc
index 3fb6b4c..a3867ed 100644
--- a/tests/pylint/pylintrc
+++ b/tests/pylint/pylintrc
@@ -36,7 +36,6 @@ disable=
unsubscriptable-object,
unsupported-membership-test,
unused-argument,
- unused-import,
unused-wildcard-import,
wildcard-import,
wrong-import-order,
@@ -75,6 +74,10 @@ disable=
# gigantic functions.
too-many-branches,
#---------------------------------------------------------------------------
+ # We have tons of unused imports, it is just a matter of removing them and
+ # leave those which have a "magic" purpose.
+ unused-import,
+ #---------------------------------------------------------------------------
# Enabling these warnings would be nice, they are mostly a sign of sloppy
# programming practice. In some cases, they can even hide bugs.
bare-except,