From 0b86b302a2c4ed5d03d50ea282e96bb9ddc7b3c8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 31 Oct 2017 07:35:00 +0100 Subject: [PATCH] pylint: Turn off some more too-many-* stuff globally Humans are just better at judging what's okay here than a machine. --- .pylintrc | 5 ++++- qutebrowser/app.py | 1 - qutebrowser/commands/command.py | 2 -- qutebrowser/misc/split.py | 1 - scripts/asciidoc2html.py | 1 - tests/unit/browser/webkit/test_webkitelem.py | 1 - tests/unit/config/test_configinit.py | 1 - 7 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.pylintrc b/.pylintrc index 443979bcd..bca11bf80 100644 --- a/.pylintrc +++ b/.pylintrc @@ -41,7 +41,10 @@ disable=no-self-use, unsupported-membership-test, unsupported-assignment-operation, unsubscriptable-object, - too-many-boolean-expressions + too-many-boolean-expressions, + too-many-locals, + too-many-branches, + too-many-statements [BASIC] function-rgx=[a-z_][a-z0-9_]{2,50}$ diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 7fb87014e..2ed579f61 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -417,7 +417,6 @@ def _init_modules(args, crash_handler): args: The argparse namespace. crash_handler: The CrashHandler instance. """ - # pylint: disable=too-many-statements log.init.debug("Initializing save manager...") save_manager = savemanager.SaveManager(qApp) objreg.register('save-manager', save_manager) diff --git a/qutebrowser/commands/command.py b/qutebrowser/commands/command.py index 9baa4efe7..43a8824d1 100644 --- a/qutebrowser/commands/command.py +++ b/qutebrowser/commands/command.py @@ -81,8 +81,6 @@ class Command: deprecated=False, no_cmd_split=False, star_args_optional=False, scope='global', backend=None, no_replace_variables=False): - # I really don't know how to solve this in a better way, I tried. - # 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: diff --git a/qutebrowser/misc/split.py b/qutebrowser/misc/split.py index 3f3b2d362..045d9fe4b 100644 --- a/qutebrowser/misc/split.py +++ b/qutebrowser/misc/split.py @@ -57,7 +57,6 @@ class ShellLexer: def __iter__(self): # pragma: no mccabe """Read a raw token from the input stream.""" - # pylint: disable=too-many-branches,too-many-statements self.reset() for nextchar in self.string: if self.state == ' ': diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py index 0055c5a42..51deb009f 100755 --- a/scripts/asciidoc2html.py +++ b/scripts/asciidoc2html.py @@ -117,7 +117,6 @@ class AsciiDoc: def _build_website_file(self, root, filename): """Build a single website file.""" - # pylint: disable=too-many-locals,too-many-statements src = os.path.join(root, filename) src_basename = os.path.basename(src) parts = [self._args.website[0]] diff --git a/tests/unit/browser/webkit/test_webkitelem.py b/tests/unit/browser/webkit/test_webkitelem.py index 3174d7281..c64756eb5 100644 --- a/tests/unit/browser/webkit/test_webkitelem.py +++ b/tests/unit/browser/webkit/test_webkitelem.py @@ -53,7 +53,6 @@ def get_webelem(geometry=None, frame=None, *, null=False, style=None, evaluateJavaScript. zoom_text_only: Whether zoom.text_only is set in the config """ - # pylint: disable=too-many-locals,too-many-branches elem = mock.Mock() elem.isNull.return_value = null elem.geometry.return_value = geometry diff --git a/tests/unit/config/test_configinit.py b/tests/unit/config/test_configinit.py index 1501b794d..4923b0765 100644 --- a/tests/unit/config/test_configinit.py +++ b/tests/unit/config/test_configinit.py @@ -111,7 +111,6 @@ class TestEarlyInit: def test_autoconfig_yml(self, init_patch, config_tmpdir, caplog, args, load_autoconfig, config_py, invalid_yaml): """Test interaction between config.py and autoconfig.yml.""" - # pylint: disable=too-many-locals,too-many-branches # Prepare files autoconfig_file = config_tmpdir / 'autoconfig.yml' config_py_file = config_tmpdir / 'config.py'