diff --git a/qutebrowser/api/interceptor.py b/qutebrowser/api/interceptor.py index afd23d067..a40635fca 100644 --- a/qutebrowser/api/interceptor.py +++ b/qutebrowser/api/interceptor.py @@ -27,6 +27,7 @@ from qutebrowser.extensions.interceptors import Request def register(interceptor: interceptors.InterceptorType) -> None: """Register a request interceptor. - Whenever a request happens, the interceptor gets called with a Request object. + Whenever a request happens, the interceptor gets called with a Request + object. """ interceptors.register(interceptor) diff --git a/qutebrowser/components/adblock.py b/qutebrowser/components/adblock.py index bccb53532..9baa12d7c 100644 --- a/qutebrowser/components/adblock.py +++ b/qutebrowser/components/adblock.py @@ -109,7 +109,7 @@ class HostBlocker: self._config_hosts_file = str(config_dir / 'blocked-hosts') def _is_blocked(self, request_url: QUrl, - first_party_url: QUrl = None) -> None: + first_party_url: QUrl = None) -> bool: """Check whether the given request is blocked.""" if first_party_url is not None and not first_party_url.isValid(): first_party_url = None diff --git a/qutebrowser/extensions/loader.py b/qutebrowser/extensions/loader.py index d7a106344..1383adfef 100644 --- a/qutebrowser/extensions/loader.py +++ b/qutebrowser/extensions/loader.py @@ -87,7 +87,7 @@ def add_module_info(module: types.ModuleType) -> ModuleInfo: return module.__qute_module_info # type: ignore -def load_components(*, skip_hooks=False) -> None: +def load_components(*, skip_hooks: bool = False) -> None: """Load everything from qutebrowser.components.""" for info in walk_components(): _load_component(info, skip_hooks=skip_hooks) @@ -143,7 +143,7 @@ def _get_init_context() -> InitContext: def _load_component(info: ExtensionInfo, *, - skip_hooks=False) -> types.ModuleType: + skip_hooks: bool = False) -> types.ModuleType: """Load the given extension and run its init hook (if any). Args: diff --git a/tests/unit/extensions/test_loader.py b/tests/unit/extensions/test_loader.py index 0a7edc9d3..5265c7cdf 100644 --- a/tests/unit/extensions/test_loader.py +++ b/tests/unit/extensions/test_loader.py @@ -75,6 +75,7 @@ def test_get_init_context(data_tmpdir, config_tmpdir, fake_args): def test_add_module_info(): + # pylint: disable=no-member mod = types.ModuleType('testmodule') info1 = loader.add_module_info(mod) assert mod.__qute_module_info is info1