pylint: Remove unneeded supressions.

This commit is contained in:
Florian Bruhin 2015-12-01 20:55:38 +01:00
parent a156d51844
commit 150a83d8f4
28 changed files with 21 additions and 50 deletions

View File

@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
# pylint: disable=line-too-long,bad-builtin
# pylint: disable=line-too-long
"""A keyboard-driven, vim-like browser based on PyQt5 and QtWebKit."""

View File

@ -42,7 +42,7 @@ except ImportError:
hunter = None
import qutebrowser
import qutebrowser.resources # pylint: disable=unused-import
import qutebrowser.resources
from qutebrowser.completion.models import instances as completionmodels
from qutebrowser.commands import cmdutils, runners, cmdexc
from qutebrowser.config import style, config, websettings, configexc
@ -61,7 +61,6 @@ qApp = None
def run(args):
"""Initialize everything and run the application."""
# pylint: disable=too-many-statements
if args.version:
print(version.version(short=True))
print()

View File

@ -451,7 +451,7 @@ class _Downloader:
self._finished(url, item)
class _NoCloseBytesIO(io.BytesIO): # pylint: disable=no-init
class _NoCloseBytesIO(io.BytesIO):
"""BytesIO that can't be .closed().

View File

@ -249,7 +249,6 @@ class NetworkManager(QNetworkAccessManager):
net = netrc.netrc()
authenticators = net.authenticators(reply.url().host())
if authenticators is not None:
# pylint: disable=unpacking-non-sequence
(user, _account, password) = authenticators
except FileNotFoundError:
log.misc.debug("No .netrc file found")

View File

@ -106,7 +106,6 @@ class WebElementWrapper(collections.abc.MutableMapping):
method = getattr(self._elem, name)
def _wrapper(meth, *args, **kwargs):
# pylint: disable=missing-docstring
self._check_vanished()
return meth(*args, **kwargs)

View File

@ -75,7 +75,7 @@ class Command:
deprecated=False, no_cmd_split=False, scope='global',
count=None, win_id=None):
# I really don't know how to solve this in a better way, I tried.
# pylint: disable=too-many-arguments,too-many-locals
# pylint: disable=too-many-locals
if modes is not None and not_modes is not None:
raise ValueError("Only modes or not_modes can be given!")
if modes is not None:

View File

@ -97,7 +97,6 @@ class change_filter: # pylint: disable=invalid-name
@pyqtSlot(str, str)
@functools.wraps(func)
def wrapper(sectname=None, optname=None):
# pylint: disable=missing-docstring
if sectname is None and optname is None:
# Called directly, not from a config change event.
return func()
@ -111,7 +110,6 @@ class change_filter: # pylint: disable=invalid-name
@pyqtSlot(str, str)
@functools.wraps(func)
def wrapper(wrapper_self, sectname=None, optname=None):
# pylint: disable=missing-docstring
if sectname is None and optname is None:
# Called directly, not from a config change event.
return func(wrapper_self)
@ -150,7 +148,7 @@ def _init_main_config(parent=None):
errstr = "Error while reading config:"
try:
errstr += "\n\n{} -> {}:".format(
e.section, e.option) # pylint: disable=no-member
e.section, e.option)
except AttributeError:
pass
errstr += "\n"

View File

@ -264,7 +264,6 @@ class MainWindow(QWidget):
def _connect_signals(self):
"""Connect all mainwindow signals."""
# pylint: disable=too-many-statements
key_config = objreg.get('key-config')
status = self._get_object('statusbar')

View File

@ -28,7 +28,6 @@ try:
except ImportError: # pragma: no coverage
try:
# Python2
# pylint: disable=import-error
from Tkinter import Tk
import tkMessageBox as messagebox
except ImportError:

View File

@ -349,8 +349,6 @@ class _CrashDialog(QDialog):
Args:
newest: The newest version as a string.
"""
# pylint: disable=no-member
# https://bitbucket.org/logilab/pylint/issue/73/
new_version = pkg_resources.parse_version(newest)
cur_version = pkg_resources.parse_version(qutebrowser.__version__)
lines = ['The report has been sent successfully. Thanks!']

View File

@ -23,7 +23,7 @@ At this point we can be sure we have all python 3.4 features available.
try:
# Importing hunter to register its atexit handler early so it gets called
# late.
import hunter # pylint: disable=import-error,unused-import
import hunter # pylint: disable=unused-import
except ImportError:
hunter = None
@ -35,7 +35,7 @@ import signal
import operator
import importlib
try:
import tkinter # pylint: disable=import-error
import tkinter
except ImportError:
tkinter = None
# NOTE: No qutebrowser or PyQt import should be done here, as some early
@ -180,7 +180,7 @@ def fix_harfbuzz(args):
def check_pyqt_core():
"""Check if PyQt core is installed."""
try:
import PyQt5.QtCore # pylint: disable=unused-variable
import PyQt5.QtCore
except ImportError as e:
text = _missing_str('PyQt5',
windows="Use the installer by Riverbank computing "

View File

@ -77,8 +77,6 @@ def version_check(version, op=operator.ge):
version: The version to check against.
op: The operator to use for the check.
"""
# pylint: disable=no-member
# https://bitbucket.org/logilab/pylint/issue/73/
return op(pkg_resources.parse_version(qVersion()),
pkg_resources.parse_version(version))
@ -244,8 +242,6 @@ class PyQIODevice(io.BufferedIOBase):
dev: The underlying QIODevice.
"""
# pylint: disable=missing-docstring
def __init__(self, dev):
super().__init__()
self.dev = dev

View File

@ -609,7 +609,7 @@ class prevent_exceptions: # pylint: disable=invalid-name
retval = self._retval
@functools.wraps(func)
def wrapper(*args, **kwargs): # pylint: disable=missing-docstring
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except BaseException:

View File

@ -168,8 +168,6 @@ def _os_info():
elif sys.platform == 'win32':
osver = ', '.join(platform.win32_ver())
elif sys.platform == 'darwin':
# pylint: disable=unpacking-non-sequence
# See https://bitbucket.org/logilab/pylint/issue/165/
release, versioninfo, machine = platform.mac_ver()
if all(not e for e in versioninfo):
versioninfo = ''

View File

@ -18,8 +18,6 @@
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
# pylint: disable=import-error,no-member
"""cx_Freeze script to run qutebrowser tests on the frozen executable."""
import sys

View File

@ -29,7 +29,6 @@ from PyQt5.QtWebKit import QWebSettings
from PyQt5.QtWebKitWidgets import QWebView
try:
# pylint: disable=no-name-in-module,import-error
from PyQt5.QtWebEngineWidgets import QWebEngineView
WEBENGINE = True
except ImportError:

View File

@ -207,7 +207,7 @@ def _generate_cmdline_tests():
def cmdline_test(request):
"""Fixture which generates tests for things validating commandlines."""
# Import qutebrowser.app so all cmdutils.register decorators get run.
import qutebrowser.app # pylint: disable=unused-variable
import qutebrowser.app
return request.param

View File

@ -281,8 +281,6 @@ class FakeTimer(QObject):
"""Stub for a usertypes.Timer."""
# pylint: disable=missing-docstring
timeout_signal = pyqtSignal()
def __init__(self, parent=None, name=None):

View File

@ -17,9 +17,6 @@
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
# pylint doesn't understand the testprocess import
# pylint: disable=no-member
"""Fixtures to run qutebrowser in a QProcess and communicate."""
import re
@ -42,6 +39,9 @@ from qutebrowser.utils import log, utils
def is_ignored_qt_message(message):
"""Check if the message is listed in qt_log_ignore."""
# pylint: disable=no-member
# WORKAROUND for https://bitbucket.org/logilab/pylint/issues/717/
# we should switch to generated-members after that
regexes = pytest.config.getini('qt_log_ignore')
for regex in regexes:
if re.match(regex, message):
@ -151,6 +151,9 @@ class QuteProc(testprocess.Process):
else:
raise
# WORKAROUND for https://bitbucket.org/logilab/pylint/issues/717/
# we should switch to generated-members after that
# pylint: disable=no-member
if (log_line.loglevel in ['INFO', 'WARNING', 'ERROR'] or
pytest.config.getoption('--verbose')):
print(line)

View File

@ -17,9 +17,6 @@
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
# pylint doesn't understand the testprocess import
# pylint: disable=no-member
"""Fixtures for the httpbin webserver."""
import sys

View File

@ -127,11 +127,6 @@ class WSGIServer(cherrypy.wsgiserver.CherryPyWSGIServer):
def main():
# pylint: disable=no-member
# WORKAROUND for https://bitbucket.org/logilab/pylint/issues/702
# "Instance of 'WSGIServer' has no 'start' member (no-member)"
# "Instance of 'WSGIServer' has no 'stop' member (no-member)"
if hasattr(sys, 'frozen'):
basedir = os.path.realpath(os.path.dirname(sys.executable))
app.template_folder = os.path.join(basedir, 'integration', 'templates')

View File

@ -275,8 +275,6 @@ def test_css_url_scanner(monkeypatch, has_cssutils, inline, style,
class TestNoCloseBytesIO:
# WORKAROUND for https://bitbucket.org/logilab/pylint/issues/540/
# pylint: disable=no-member
def test_fake_close(self):
fp = mhtml._NoCloseBytesIO()

View File

@ -281,7 +281,7 @@ class TestDefaultConfig:
def test_default_key_config(self):
"""Test validating of the default key config."""
# We import qutebrowser.app so the cmdutils.register decorators run.
import qutebrowser.app # pylint: disable=unused-variable
import qutebrowser.app
conf = keyconf.KeyConfigParser(None, None)
runner = runners.CommandRunner(win_id=0)
for sectname in configdata.KEY_DATA:

View File

@ -16,8 +16,6 @@
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
# pylint: disable=missing-docstring
"""Tests for qutebrowser.config.configexc."""
from qutebrowser.config import configexc

View File

@ -77,7 +77,7 @@ def test_patched_errwindow(capfd, mocker, monkeypatch):
lambda status: None)
try:
import tkinter # pylint: disable=unused-variable
import tkinter
except ImportError:
tk_mock = mocker.patch('qutebrowser.misc.checkpyver.Tk',
spec=['withdraw'], new_callable=mocker.Mock)

View File

@ -31,7 +31,7 @@ import subprocess
from unittest import mock
import pytest
import py.path # pylint: disable=no-name-in-module,import-error
import py.path # pylint: disable=no-name-in-module
from PyQt5.QtCore import pyqtSignal, QObject
from PyQt5.QtNetwork import QLocalServer, QLocalSocket, QAbstractSocket
from PyQt5.QtTest import QSignalSpy

View File

@ -50,7 +50,7 @@ class LineParserMixin:
else:
prev_val = None
if self._binary: # pylint: disable=no-member
if self._binary:
fobj = io.BytesIO(prev_val)
else:
fobj = io.StringIO(prev_val)

View File

@ -25,7 +25,7 @@ import itertools
import sys
import pytest
import pytest_catchlog # pylint: disable=import-error
import pytest_catchlog
from qutebrowser.utils import log