pylint: Enable useless-suppression globally.
We deactivate it locally where needed, i.e. where we are sure it's some platform-specific thing.
This commit is contained in:
parent
cf54fa1ef1
commit
eff0e4c7cc
@ -9,6 +9,7 @@ load-plugins=pylint_checkers.config,
|
|||||||
pylint_checkers.settrace
|
pylint_checkers.settrace
|
||||||
|
|
||||||
[MESSAGES CONTROL]
|
[MESSAGES CONTROL]
|
||||||
|
enable=all
|
||||||
disable=no-self-use,
|
disable=no-self-use,
|
||||||
fixme,
|
fixme,
|
||||||
global-statement,
|
global-statement,
|
||||||
@ -30,7 +31,8 @@ disable=no-self-use,
|
|||||||
wrong-import-order,
|
wrong-import-order,
|
||||||
ungrouped-imports,
|
ungrouped-imports,
|
||||||
wrong-import-position,
|
wrong-import-position,
|
||||||
redefined-variable-type
|
redefined-variable-type,
|
||||||
|
suppressed-message
|
||||||
|
|
||||||
[BASIC]
|
[BASIC]
|
||||||
function-rgx=[a-z_][a-z0-9_]{2,50}$
|
function-rgx=[a-z_][a-z0-9_]{2,50}$
|
||||||
|
@ -57,7 +57,8 @@ class SslError(QSslError):
|
|||||||
def __hash__(self):
|
def __hash__(self):
|
||||||
try:
|
try:
|
||||||
# Qt >= 5.4
|
# Qt >= 5.4
|
||||||
return super().__hash__() # pylint: disable=not-callable
|
# pylint: disable=not-callable,useless-suppression
|
||||||
|
return super().__hash__()
|
||||||
except TypeError:
|
except TypeError:
|
||||||
return hash((self.certificate().toDer(), self.error()))
|
return hash((self.certificate().toDer(), self.error()))
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ class _QtFIFOReader(QObject):
|
|||||||
# See http://www.outflux.net/blog/archives/2008/03/09/using-select-on-a-fifo/
|
# 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
|
# We also use os.open and os.fdopen rather than built-in open so we
|
||||||
# can add O_NONBLOCK.
|
# can add O_NONBLOCK.
|
||||||
fd = os.open(filepath, os.O_RDWR |
|
# pylint: disable=no-member,useless-suppression
|
||||||
os.O_NONBLOCK) # pylint: disable=no-member
|
fd = os.open(filepath, os.O_RDWR | os.O_NONBLOCK)
|
||||||
self.fifo = os.fdopen(fd, 'r')
|
self.fifo = os.fdopen(fd, 'r')
|
||||||
self._notifier = QSocketNotifier(fd, QSocketNotifier.Read, self)
|
self._notifier = QSocketNotifier(fd, QSocketNotifier.Read, self)
|
||||||
self._notifier.activated.connect(self.read_line)
|
self._notifier.activated.connect(self.read_line)
|
||||||
@ -175,7 +175,8 @@ class _POSIXUserscriptRunner(_BaseUserscriptRunner):
|
|||||||
# exist, it shouldn't be a big issue.
|
# exist, it shouldn't be a big issue.
|
||||||
self._filepath = tempfile.mktemp(prefix='qutebrowser-userscript-',
|
self._filepath = tempfile.mktemp(prefix='qutebrowser-userscript-',
|
||||||
dir=standarddir.runtime())
|
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:
|
except OSError as e:
|
||||||
message.error(self._win_id, "Error while creating FIFO: {}".format(
|
message.error(self._win_id, "Error while creating FIFO: {}".format(
|
||||||
e))
|
e))
|
||||||
|
@ -308,7 +308,7 @@ class SignalHandler(QObject):
|
|||||||
signal.SIGTERM, self.interrupt)
|
signal.SIGTERM, self.interrupt)
|
||||||
|
|
||||||
if os.name == 'posix' and hasattr(signal, 'set_wakeup_fd'):
|
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
|
import fcntl
|
||||||
read_fd, write_fd = os.pipe()
|
read_fd, write_fd = os.pipe()
|
||||||
for fd in (read_fd, write_fd):
|
for fd in (read_fd, write_fd):
|
||||||
|
@ -123,7 +123,8 @@ def init_faulthandler(fileobj=sys.__stderr__):
|
|||||||
faulthandler.enable(fileobj)
|
faulthandler.enable(fileobj)
|
||||||
if hasattr(faulthandler, 'register') and hasattr(signal, 'SIGUSR1'):
|
if hasattr(faulthandler, 'register') and hasattr(signal, 'SIGUSR1'):
|
||||||
# If available, we also want a traceback on 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):
|
def fix_harfbuzz(args):
|
||||||
|
@ -259,7 +259,7 @@ def qt_message_handler(msg_type, context, msg):
|
|||||||
QtCore.QtFatalMsg: logging.CRITICAL,
|
QtCore.QtFatalMsg: logging.CRITICAL,
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member,useless-suppression
|
||||||
qt_to_logging[QtCore.QtInfoMsg] = logging.INFO
|
qt_to_logging[QtCore.QtInfoMsg] = logging.INFO
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
# Qt < 5.5
|
# Qt < 5.5
|
||||||
|
@ -29,7 +29,7 @@ import os.path
|
|||||||
import sys
|
import sys
|
||||||
import distutils
|
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.
|
# 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,
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir,
|
||||||
|
@ -26,7 +26,7 @@ import os.path
|
|||||||
import sys
|
import sys
|
||||||
import contextlib
|
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.
|
# cx_Freeze is hard to install (needs C extensions) so we don't check for it.
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ class TestListen:
|
|||||||
|
|
||||||
@pytest.mark.posix
|
@pytest.mark.posix
|
||||||
def test_permissions_posix(self, ipc_server):
|
def test_permissions_posix(self, ipc_server):
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member,useless-suppression
|
||||||
ipc_server.listen()
|
ipc_server.listen()
|
||||||
sockfile = ipc_server._server.fullServerName()
|
sockfile = ipc_server._server.fullServerName()
|
||||||
sockdir = os.path.dirname(sockfile)
|
sockdir = os.path.dirname(sockfile)
|
||||||
|
@ -25,7 +25,8 @@ import sys
|
|||||||
import operator
|
import operator
|
||||||
import os.path
|
import os.path
|
||||||
try:
|
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:
|
except ImportError:
|
||||||
# Debian patches Python to remove the tests...
|
# Debian patches Python to remove the tests...
|
||||||
test_file = None
|
test_file = None
|
||||||
@ -748,10 +749,11 @@ class TestPyQIODevice:
|
|||||||
|
|
||||||
def test_seek_unsupported(self, pyqiodev):
|
def test_seek_unsupported(self, pyqiodev):
|
||||||
"""Test seeking with unsupported whence arguments."""
|
"""Test seeking with unsupported whence arguments."""
|
||||||
|
# pylint: disable=no-member,useless-suppression
|
||||||
if hasattr(os, 'SEEK_HOLE'):
|
if hasattr(os, 'SEEK_HOLE'):
|
||||||
whence = os.SEEK_HOLE # pylint: disable=no-member
|
whence = os.SEEK_HOLE
|
||||||
elif hasattr(os, 'SEEK_DATA'):
|
elif hasattr(os, 'SEEK_DATA'):
|
||||||
whence = os.SEEK_DATA # pylint: disable=no-member
|
whence = os.SEEK_DATA
|
||||||
else:
|
else:
|
||||||
pytest.skip("Needs os.SEEK_HOLE or os.SEEK_DATA available.")
|
pytest.skip("Needs os.SEEK_HOLE or os.SEEK_DATA available.")
|
||||||
pyqiodev.open(QIODevice.ReadOnly)
|
pyqiodev.open(QIODevice.ReadOnly)
|
||||||
|
Loading…
Reference in New Issue
Block a user