linting cleanup

This commit is contained in:
Florian Bruhin 2014-04-22 17:53:27 +02:00
parent 2bef265a89
commit 55e3aca702
9 changed files with 15 additions and 22 deletions

View File

@ -3,6 +3,7 @@
# E265: Block comment should start with '#'
# F401: Unused import (checked by pylint)
# E501: Line too long (checked by pylint)
ignore=E241,E265,F401,E501
# E821: undefined name (checked by pylint)
ignore=E241,E265,F401,E501,E821
max_complexity = 10
exclude = appdirs.py

View File

@ -35,7 +35,7 @@ ignore-long-lines=<?https?://
min-similarity-lines=6
[VARIABLES]
dummy-variables-rgx=_$
dummy-variables-rgx=_.*
[CLASSES]
defining-attr-methods=__init__,__new__,setUp

View File

@ -450,9 +450,8 @@ class HintManager(QObject):
if self._target != 'rapid':
self.stop()
# pylint: disable=unused-argument
@pyqtSlot('QSize')
def on_contents_size_changed(self, size):
def on_contents_size_changed(self, _size):
"""Reposition hints if contents size changed."""
for elems in self._elems.values():
rect = elems.elem.geometry()

View File

@ -96,9 +96,8 @@ class CommandKeyParser(KeyParser):
"""Handle a completed keychain."""
self._run_or_fill(cmdstr, count, ignore_exc=False)
# pylint: disable=unused-argument
@pyqtSlot(str, str)
def on_config_changed(self, section, option):
def on_config_changed(self, section, _option):
"""Re-read the config if a keybinding was changed."""
if section == 'keybind':
self.read_config()

View File

@ -62,15 +62,13 @@ def set_register_stylesheet(obj):
config.instance.changed.connect(partial(_update_stylesheet, obj))
def _update_stylesheet(obj, section, option):
def _update_stylesheet(obj, _section, _option):
"""Update the stylesheet for obj."""
# pylint: disable=unused-argument
obj.setStyleSheet(get_stylesheet(obj.STYLESHEET))
def invalidate_caches(section, option):
def invalidate_caches(section, _option):
"""Invalidate cached dicts."""
# pylint: disable=unused-argument
global _colordict, _fontdict
if section == 'colors':
_colordict = None

View File

@ -148,7 +148,7 @@ class CompletionModel(QAbstractItemModel):
node.children.pop(position)
self.endRemoveRows()
def columnCount(self, parent=QModelIndex()):
def columnCount(self, _parent=QModelIndex()):
"""Return the column count in the model.
Override QAbstractItemModel::columnCount.
@ -160,7 +160,6 @@ class CompletionModel(QAbstractItemModel):
Return:
Column count as an integer.
"""
# pylint: disable=unused-argument
return self._root.column_count()
def rowCount(self, parent=QModelIndex()):

View File

@ -76,18 +76,17 @@ class QuteSchemeHandler(SchemeHandler):
"""
return url.replace('http://', '').replace('qute:', 'qute_')
def createRequest(self, op, request, outgoing_data):
def createRequest(self, _op, request, _outgoing_data):
"""Create a new request.
Args:
op: Operation op
request: const QNetworkRequest & req
outgoing_data: QIODevice * outgoingData
_op: Operation op
_outgoing_data: QIODevice * outgoingData
Return:
A QNetworkReply.
"""
# pylint: disable=unused-argument
logging.debug('request: {}'.format(request))
url = urlstring(request.url())
try:

View File

@ -658,9 +658,8 @@ class _Url(TextBase):
self.setText(urlstring(s))
self.urltype = 'normal'
# pylint: disable=unused-argument
@pyqtSlot(str, str, str)
def set_hover_url(self, link, title, text):
def set_hover_url(self, link, _title, _text):
"""Setter to be used as a Qt slot.
Saves old shown URL in self._old_url and restores it later if a link is
@ -668,8 +667,8 @@ class _Url(TextBase):
Args:
link: The link which was hovered (string)
title: The title of the hovered link (string)
text: The text of the hovered link (string)
_title: The title of the hovered link (string)
_text: The text of the hovered link (string)
"""
if link:
if self._old_url is None:

View File

@ -97,9 +97,8 @@ class TabWidget(QTabWidget):
except KeyError:
pass
# pylint: disable=unused-argument
@pyqtSlot(str, str)
def on_config_changed(self, section, option):
def on_config_changed(self, section, _option):
"""Update attributes when config changed."""
if section == 'tabbar':
self._init_config()