diff --git a/qutebrowser/utils/config.py b/qutebrowser/utils/config.py index 9c0ee7b06..cfa47691f 100644 --- a/qutebrowser/utils/config.py +++ b/qutebrowser/utils/config.py @@ -3,7 +3,6 @@ import os import logging from configparser import ConfigParser -# pylint: disable=abstract-class-little-used config = None colordict = {} diff --git a/qutebrowser/widgets/completion.py b/qutebrowser/widgets/completion.py index 0d1dc2321..d7dd329af 100644 --- a/qutebrowser/widgets/completion.py +++ b/qutebrowser/widgets/completion.py @@ -80,7 +80,7 @@ class CompletionView(QTreeView): self.model.pattern = '' self.expandAll() - def resort(self, pattern): # pylint: disable=unused-argument + def resort(self, pattern): # pylint: disable=unused-argument try: self.model.sourceModel().sort(0) except NotImplementedError: @@ -216,7 +216,7 @@ class CompletionItemDelegate(QStyledItemDelegate): text_rect = text_rect_.adjusted(margin, 0, -margin, 0) self.painter.save() state = self.opt.state - if (state & QStyle.State_Enabled and state & QStyle.State_Active): + if state & QStyle.State_Enabled and state & QStyle.State_Active: cg = QPalette.Normal elif state & QStyle.State_Enabled: cg = QPalette.Inactive diff --git a/qutebrowser/widgets/statusbar/command.py b/qutebrowser/widgets/statusbar/command.py index f3e6992cf..2fec81250 100644 --- a/qutebrowser/widgets/statusbar/command.py +++ b/qutebrowser/widgets/statusbar/command.py @@ -9,7 +9,7 @@ class Command(QLineEdit): """The commandline part of the statusbar""" # Emitted when a command is triggered by the user got_cmd = pyqtSignal(str) - bar = None # The status bar object + statusbar = None # The status bar object esc_pressed = pyqtSignal() # Emitted when escape is pressed tab_pressed = pyqtSignal(bool) # Emitted when tab is pressed (arg: shift) hide_completion = pyqtSignal() # Hide completion window @@ -18,14 +18,13 @@ class Command(QLineEdit): _histpos = None # FIXME won't the tab key switch to the next widget? - # See - # noqa http://www.saltycrane.com/blog/2008/01/how-to-capture-tab-key-press-event-with/ - # for a possible fix. + # See [0] for a possible fix. + # [0] http://www.saltycrane.com/blog/2008/01/how-to-capture-tab-key-press-event-with/ # noqa # pylint: disable=line-too-long - def __init__(self, bar): - super().__init__(bar) + def __init__(self, statusbar): + super().__init__(statusbar) # FIXME - self.bar = bar + self.statusbar = statusbar self.setStyleSheet("border: 0px; padding-left: 1px") self.setValidator(Validator()) self.returnPressed.connect(self.process_cmd) @@ -72,7 +71,7 @@ class Command(QLineEdit): def focusInEvent(self, e): """Clear error message when the statusbar is focused""" - self.bar.clear_error() + self.statusbar.clear_error() super().focusInEvent(e) def _histbrowse_start(self): diff --git a/qutebrowser/widgets/statusbar/progress.py b/qutebrowser/widgets/statusbar/progress.py index 473f55a14..2b9191112 100644 --- a/qutebrowser/widgets/statusbar/progress.py +++ b/qutebrowser/widgets/statusbar/progress.py @@ -6,7 +6,7 @@ from PyQt5.QtCore import QSize class Progress(QProgressBar): """ The progress bar part of the status bar""" - bar = None + statusbar = None color = None _stylesheet = """ QProgressBar {{ @@ -20,9 +20,9 @@ class Progress(QProgressBar): }} """ - def __init__(self, bar): - self.bar = bar - super().__init__(bar) + def __init__(self, statusbar): + self.statusbar = statusbar + super().__init__(statusbar) self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) self.setTextVisible(False) @@ -37,7 +37,7 @@ class Progress(QProgressBar): self.setStyleSheet(config.get_stylesheet(self._stylesheet)) def minimumSizeHint(self): - status_size = self.bar.size() + status_size = self.statusbar.size() return QSize(100, status_size.height()) def sizeHint(self): diff --git a/qutebrowser/widgets/statusbar/text.py b/qutebrowser/widgets/statusbar/text.py index 083c9bce4..a8c3f5bb0 100644 --- a/qutebrowser/widgets/statusbar/text.py +++ b/qutebrowser/widgets/statusbar/text.py @@ -23,6 +23,7 @@ class Text(QLabel): def set_perc(self, x, y): """Setter to be used as a Qt slot""" + # pylint: disable=unused-argument if y == 0: self.scrollperc = '[top]' elif y == 100: diff --git a/run_checks.py b/run_checks.py index 4713f93e0..eba9a4d60 100644 --- a/run_checks.py +++ b/run_checks.py @@ -66,16 +66,17 @@ def _check_crlf(fn): pylint_disable = [ - 'import-error', # import seems unreliable + 'import-error', # import seems unreliable 'no-name-in-module', - 'invalid-name', # short variable names can be nice - 'star-args', # we want to use this - 'fixme', # I'll decide myself when to fix them - 'too-many-public-methods', # Basically unavoidable with Qt - 'no-self-use', # I'll decide that myself, thanks - 'super-on-old-class', # These don't even exist in python3 + 'invalid-name', # short variable names can be nice + 'star-args', # we want to use this + 'fixme', # I'll decide myself when to fix them + 'too-many-public-methods', # Basically unavoidable with Qt + 'no-self-use', # I'll decide that myself, thanks + 'super-on-old-class', # These don't even exist in python3 'old-style-class', - 'global-statement', # Sometimes necessary + 'global-statement', # Sometimes necessary + 'abstract-class-little-used', # False-positives ] flake8_disable = [