summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2018-12-10 16:05:17 +0100
committerFlorian Bruhin <me@the-compiler.org>2018-12-10 16:33:24 +0100
commit35a3fe029d381053c12b44b5f1d111cfabf3f047 (patch)
treeff1d3dc4063254e0d46718bed9715aa413870637
parent4e99caafb9f9772155bbf5de18e8bad60b2127e0 (diff)
downloadqutebrowser-35a3fe029d381053c12b44b5f1d111cfabf3f047.tar.gz
qutebrowser-35a3fe029d381053c12b44b5f1d111cfabf3f047.zip
Fix lint
-rw-r--r--.flake81
-rw-r--r--qutebrowser/api/downloads.py4
-rw-r--r--qutebrowser/api/hook.py4
-rw-r--r--qutebrowser/api/requests.py5
-rw-r--r--qutebrowser/components/adblock.py4
-rw-r--r--qutebrowser/extensions/loader.py2
-rwxr-xr-xscripts/dev/run_vulture.py3
7 files changed, 15 insertions, 8 deletions
diff --git a/.flake8 b/.flake8
index 8c03ef729..7a783a4b0 100644
--- a/.flake8
+++ b/.flake8
@@ -46,6 +46,7 @@ ignore =
min-version = 3.4.0
max-complexity = 12
per-file-ignores =
+ /qutebrowser/api/hook.py : N801
/tests/**/*.py : D100,D101,D401
/tests/unit/browser/test_history.py : N806
/tests/helpers/fixtures.py : N806
diff --git a/qutebrowser/api/downloads.py b/qutebrowser/api/downloads.py
index f743f5d7a..82c68d0bd 100644
--- a/qutebrowser/api/downloads.py
+++ b/qutebrowser/api/downloads.py
@@ -18,6 +18,9 @@
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
+"""APIs related to downloading files."""
+
+
import io
from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot, QUrl
@@ -33,6 +36,7 @@ class TempDownload(QObject):
finished = pyqtSignal()
def __init__(self, item: qtnetworkdownloads.DownloadItem) -> None:
+ super().__init__()
self._item = item
self._item.finished.connect(self._on_download_finished)
self.successful = False
diff --git a/qutebrowser/api/hook.py b/qutebrowser/api/hook.py
index bd8e2a635..3f06121da 100644
--- a/qutebrowser/api/hook.py
+++ b/qutebrowser/api/hook.py
@@ -17,6 +17,8 @@
# 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=invalid-name
+
"""Hooks for extensions."""
import importlib
@@ -32,7 +34,7 @@ def _add_module_info(func: typing.Callable) -> loader.ModuleInfo:
return loader.add_module_info(module)
-class init: # noqa: N801,N806 pylint: disable=invalid-name
+class init:
"""Decorator to mark a function to run when initializing."""
diff --git a/qutebrowser/api/requests.py b/qutebrowser/api/requests.py
index 990faec88..5c23418b4 100644
--- a/qutebrowser/api/requests.py
+++ b/qutebrowser/api/requests.py
@@ -19,11 +19,6 @@
"""APIs related to intercepting/blocking requests."""
-import typing
-
-import attr
-from PyQt5.QtCore import QUrl
-
from qutebrowser.extensions import requests
# pylint: disable=unused-import
from qutebrowser.extensions.requests import Request
diff --git a/qutebrowser/components/adblock.py b/qutebrowser/components/adblock.py
index aad802bd2..706620948 100644
--- a/qutebrowser/components/adblock.py
+++ b/qutebrowser/components/adblock.py
@@ -76,7 +76,8 @@ class _FakeDownload(downloads.TempDownload):
"""A download stub to use on_download_finished with local files."""
- def __init__(self, fileobj: typing.IO[bytes]) -> None:
+ def __init__(self, # pylint: disable=super-init-not-called
+ fileobj: typing.IO[bytes]) -> None:
self.fileobj = fileobj
self.successful = True
@@ -337,6 +338,7 @@ def on_config_changed() -> None:
@hook.init()
def init(context: apitypes.InitContext) -> None:
+ """Initialize the host blocker."""
global _host_blocker
_host_blocker = HostBlocker(data_dir=context.data_dir,
config_dir=context.config_dir,
diff --git a/qutebrowser/extensions/loader.py b/qutebrowser/extensions/loader.py
index 338449c5b..1a9b3d858 100644
--- a/qutebrowser/extensions/loader.py
+++ b/qutebrowser/extensions/loader.py
@@ -28,7 +28,7 @@ import pathlib
import attr
-from PyQt5.QtCore import pyqtSlot, QObject
+from PyQt5.QtCore import pyqtSlot
from qutebrowser import components
from qutebrowser.config import config
diff --git a/scripts/dev/run_vulture.py b/scripts/dev/run_vulture.py
index 51662f3c9..f9262c946 100755
--- a/scripts/dev/run_vulture.py
+++ b/scripts/dev/run_vulture.py
@@ -130,6 +130,9 @@ def whitelist_generator(): # noqa
yield 'scripts.get_coredumpctl_traces.Line.gid'
yield 'scripts.importer.import_moz_places.places.row_factory'
+ # component hooks
+ yield 'qutebrowser.components.adblock.on_config_changed'
+
def filter_func(item):
"""Check if a missing function should be filtered or not.