diff --git a/.pylintrc b/.pylintrc index cc8941f49..cf61e8cd9 100644 --- a/.pylintrc +++ b/.pylintrc @@ -9,6 +9,7 @@ load-plugins=pylint_checkers.config, pylint_checkers.settrace [MESSAGES CONTROL] +enable=all disable=no-self-use, fixme, global-statement, @@ -30,7 +31,8 @@ disable=no-self-use, wrong-import-order, ungrouped-imports, wrong-import-position, - redefined-variable-type + redefined-variable-type, + suppressed-message [BASIC] function-rgx=[a-z_][a-z0-9_]{2,50}$ diff --git a/qutebrowser/browser/network/networkmanager.py b/qutebrowser/browser/network/networkmanager.py index 79f73e58e..e53cc48da 100644 --- a/qutebrowser/browser/network/networkmanager.py +++ b/qutebrowser/browser/network/networkmanager.py @@ -57,7 +57,8 @@ class SslError(QSslError): def __hash__(self): try: # Qt >= 5.4 - return super().__hash__() # pylint: disable=not-callable + # pylint: disable=not-callable,useless-suppression + return super().__hash__() except TypeError: return hash((self.certificate().toDer(), self.error())) diff --git a/qutebrowser/commands/userscripts.py b/qutebrowser/commands/userscripts.py index 88ad04d93..518fb636c 100644 --- a/qutebrowser/commands/userscripts.py +++ b/qutebrowser/commands/userscripts.py @@ -44,8 +44,8 @@ class _QtFIFOReader(QObject): # See http://www.outflux.net/blog/archives/2008/03/09/using-select-on-a-fifo/ # We also use os.open and os.fdopen rather than built-in open so we # can add O_NONBLOCK. - fd = os.open(filepath, os.O_RDWR | - os.O_NONBLOCK) # pylint: disable=no-member + # pylint: disable=no-member,useless-suppression + fd = os.open(filepath, os.O_RDWR | os.O_NONBLOCK) self.fifo = os.fdopen(fd, 'r') self._notifier = QSocketNotifier(fd, QSocketNotifier.Read, self) self._notifier.activated.connect(self.read_line) @@ -175,7 +175,8 @@ class _POSIXUserscriptRunner(_BaseUserscriptRunner): # exist, it shouldn't be a big issue. self._filepath = tempfile.mktemp(prefix='qutebrowser-userscript-', dir=standarddir.runtime()) - os.mkfifo(self._filepath) # pylint: disable=no-member + # pylint: disable=no-member,useless-suppression + os.mkfifo(self._filepath) except OSError as e: message.error(self._win_id, "Error while creating FIFO: {}".format( e)) diff --git a/qutebrowser/misc/crashsignal.py b/qutebrowser/misc/crashsignal.py index 940d23de2..e5a419505 100644 --- a/qutebrowser/misc/crashsignal.py +++ b/qutebrowser/misc/crashsignal.py @@ -308,7 +308,7 @@ class SignalHandler(QObject): signal.SIGTERM, self.interrupt) if os.name == 'posix' and hasattr(signal, 'set_wakeup_fd'): - # pylint: disable=import-error,no-member + # pylint: disable=import-error,no-member,useless-suppression import fcntl read_fd, write_fd = os.pipe() for fd in (read_fd, write_fd): diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index 3014fbaac..e052e0c35 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -123,7 +123,8 @@ def init_faulthandler(fileobj=sys.__stderr__): faulthandler.enable(fileobj) if hasattr(faulthandler, 'register') and hasattr(signal, 'SIGUSR1'): # If available, we also want a traceback on SIGUSR1. - faulthandler.register(signal.SIGUSR1) # pylint: disable=no-member + # pylint: disable=no-member,useless-suppression + faulthandler.register(signal.SIGUSR1) def fix_harfbuzz(args): diff --git a/qutebrowser/utils/log.py b/qutebrowser/utils/log.py index 4626b54b7..003faa5e4 100644 --- a/qutebrowser/utils/log.py +++ b/qutebrowser/utils/log.py @@ -259,7 +259,7 @@ def qt_message_handler(msg_type, context, msg): QtCore.QtFatalMsg: logging.CRITICAL, } try: - # pylint: disable=no-member + # pylint: disable=no-member,useless-suppression qt_to_logging[QtCore.QtInfoMsg] = logging.INFO except AttributeError: # Qt < 5.5 diff --git a/scripts/dev/freeze.py b/scripts/dev/freeze.py index cc469e7af..ab0c2f8ae 100755 --- a/scripts/dev/freeze.py +++ b/scripts/dev/freeze.py @@ -29,7 +29,7 @@ import os.path import sys import distutils -import cx_Freeze as cx # pylint: disable=import-error +import cx_Freeze as cx # pylint: disable=import-error,useless-suppression # cx_Freeze is hard to install (needs C extensions) so we don't check for it. sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, diff --git a/scripts/dev/freeze_tests.py b/scripts/dev/freeze_tests.py index e8e3e6f78..914ff9e2e 100755 --- a/scripts/dev/freeze_tests.py +++ b/scripts/dev/freeze_tests.py @@ -26,7 +26,7 @@ import os.path import sys import contextlib -import cx_Freeze as cx # pylint: disable=import-error +import cx_Freeze as cx # pylint: disable=import-error,useless-suppression # cx_Freeze is hard to install (needs C extensions) so we don't check for it. import pytest diff --git a/tests/unit/misc/test_ipc.py b/tests/unit/misc/test_ipc.py index d7aee0ed1..bc6715137 100644 --- a/tests/unit/misc/test_ipc.py +++ b/tests/unit/misc/test_ipc.py @@ -316,7 +316,7 @@ class TestListen: @pytest.mark.posix def test_permissions_posix(self, ipc_server): - # pylint: disable=no-member + # pylint: disable=no-member,useless-suppression ipc_server.listen() sockfile = ipc_server._server.fullServerName() sockdir = os.path.dirname(sockfile) diff --git a/tests/unit/utils/test_qtutils.py b/tests/unit/utils/test_qtutils.py index 7653ef61d..b2d733423 100644 --- a/tests/unit/utils/test_qtutils.py +++ b/tests/unit/utils/test_qtutils.py @@ -25,7 +25,8 @@ import sys import operator import os.path try: - from test import test_file # pylint: disable=no-name-in-module + # pylint: disable=no-name-in-module,useless-suppression + from test import test_file except ImportError: # Debian patches Python to remove the tests... test_file = None @@ -748,10 +749,11 @@ class TestPyQIODevice: def test_seek_unsupported(self, pyqiodev): """Test seeking with unsupported whence arguments.""" + # pylint: disable=no-member,useless-suppression if hasattr(os, 'SEEK_HOLE'): - whence = os.SEEK_HOLE # pylint: disable=no-member + whence = os.SEEK_HOLE elif hasattr(os, 'SEEK_DATA'): - whence = os.SEEK_DATA # pylint: disable=no-member + whence = os.SEEK_DATA else: pytest.skip("Needs os.SEEK_HOLE or os.SEEK_DATA available.") pyqiodev.open(QIODevice.ReadOnly)