From 2a3b9a2e26fc9570c2dd2f070257968a2b3a1149 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 7 Sep 2021 13:34:35 +0200 Subject: [PATCH] [pylint] searx: drop no longer needed 'missing-function-docstring' Suggested-by: @dalf https://github.com/searxng/searxng/issues/102#issuecomment-914168470 Signed-off-by: Markus Heiser --- searx/__init__.py | 2 +- searx/flaskfix.py | 2 +- searx/metrics/__init__.py | 2 +- searx/network/__init__.py | 2 +- searx/network/client.py | 2 +- searx/network/network.py | 2 +- searx/network/raise_for_httperror.py | 1 - searx/preferences.py | 18 +++++++++--------- searx/search/__init__.py | 2 +- searx/search/checker/__main__.py | 2 +- searx/search/checker/background.py | 2 +- searx/search/processors/abstract.py | 2 -- searx/search/processors/online_currency.py | 2 -- searx/settings_defaults.py | 1 - searx/unixthreadname.py | 2 +- searx/version.py | 2 +- searx/webapp.py | 1 - 17 files changed, 20 insertions(+), 27 deletions(-) diff --git a/searx/__init__.py b/searx/__init__.py index 0b73d5204..265f926bc 100644 --- a/searx/__init__.py +++ b/searx/__init__.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring, missing-module-docstring +# pylint: disable=missing-module-docstring from os.path import dirname, abspath import logging diff --git a/searx/flaskfix.py b/searx/flaskfix.py index c069df453..47aabfa53 100644 --- a/searx/flaskfix.py +++ b/searx/flaskfix.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-module-docstring,missing-function-docstring +# pylint: disable=missing-module-docstring from urllib.parse import urlparse diff --git a/searx/metrics/__init__.py b/searx/metrics/__init__.py index 2ef73149b..995f182af 100644 --- a/searx/metrics/__init__.py +++ b/searx/metrics/__init__.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-module-docstring, missing-function-docstring +# pylint: disable=missing-module-docstring import typing import math diff --git a/searx/network/__init__.py b/searx/network/__init__.py index 3dc99da48..7b0396a12 100644 --- a/searx/network/__init__.py +++ b/searx/network/__init__.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-module-docstring, missing-function-docstring, global-statement +# pylint: disable=missing-module-docstring, global-statement import asyncio import threading diff --git a/searx/network/client.py b/searx/network/client.py index 60171e6c3..187ae5366 100644 --- a/searx/network/client.py +++ b/searx/network/client.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-module-docstring, missing-function-docstring, global-statement +# pylint: disable=missing-module-docstring, global-statement import asyncio import logging diff --git a/searx/network/network.py b/searx/network/network.py index 94e91593d..d09a2ee0e 100644 --- a/searx/network/network.py +++ b/searx/network/network.py @@ -1,7 +1,7 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint # pylint: disable=global-statement -# pylint: disable=missing-module-docstring, missing-class-docstring, missing-function-docstring +# pylint: disable=missing-module-docstring, missing-class-docstring import atexit import asyncio diff --git a/searx/network/raise_for_httperror.py b/searx/network/raise_for_httperror.py index 0f550918d..a2f554614 100644 --- a/searx/network/raise_for_httperror.py +++ b/searx/network/raise_for_httperror.py @@ -1,6 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring """Raise exception for an HTTP response is an error. """ diff --git a/searx/preferences.py b/searx/preferences.py index c19a11f4b..26506556a 100644 --- a/searx/preferences.py +++ b/searx/preferences.py @@ -117,7 +117,7 @@ class MultipleChoiceSetting(EnumStringSetting): self._validate_selections(elements) self.value = elements - def parse_form(self, data): # pylint: disable=missing-function-docstring + def parse_form(self, data): if self.locked: return @@ -154,7 +154,7 @@ class SetSetting(Setting): for element in elements: self.values.add(element) - def parse_form(self, data): # pylint: disable=missing-function-docstring + def parse_form(self, data): if self.locked: return @@ -226,22 +226,22 @@ class SwitchableSetting(Setting): if not hasattr(self, 'choices'): raise MissingArgumentException('missing argument: choices') - def transform_form_items(self, items): # pylint: disable=missing-function-docstring + def transform_form_items(self, items): # pylint: disable=no-self-use return items - def transform_values(self, values): # pylint: disable=missing-function-docstring + def transform_values(self, values): # pylint: disable=no-self-use return values - def parse_cookie(self, data): # pylint: disable=missing-function-docstring + def parse_cookie(self, data): # pylint: disable=attribute-defined-outside-init if data[DISABLED] != '': self.disabled = set(data[DISABLED].split(',')) if data[ENABLED] != '': self.enabled = set(data[ENABLED].split(',')) - def parse_form(self, items): # pylint: disable=missing-function-docstring + def parse_form(self, items): if self.locked: return @@ -262,14 +262,14 @@ class SwitchableSetting(Setting): resp.set_cookie('disabled_{0}'.format(self.value), ','.join(self.disabled), max_age=COOKIE_MAX_AGE) resp.set_cookie('enabled_{0}'.format(self.value), ','.join(self.enabled), max_age=COOKIE_MAX_AGE) - def get_disabled(self): # pylint: disable=missing-function-docstring + def get_disabled(self): disabled = self.disabled for choice in self.choices: # pylint: disable=no-member if not choice['default_on'] and choice['id'] not in self.enabled: disabled.add(choice['id']) return self.transform_values(disabled) - def get_enabled(self): # pylint: disable=missing-function-docstring + def get_enabled(self): enabled = self.enabled for choice in self.choices: # pylint: disable=no-member if choice['default_on'] and choice['id'] not in self.disabled: @@ -515,7 +515,7 @@ class Preferences: resp.set_cookie(k, v, max_age=COOKIE_MAX_AGE) return resp - def validate_token(self, engine): # pylint: disable=missing-function-docstring + def validate_token(self, engine): valid = True if hasattr(engine, 'tokens') and engine.tokens: valid = False diff --git a/searx/search/__init__.py b/searx/search/__init__.py index 041a54c4b..d8d3e1e1c 100644 --- a/searx/search/__init__.py +++ b/searx/search/__init__.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-module-docstring, missing-function-docstring +# pylint: disable=missing-module-docstring import typing import threading diff --git a/searx/search/checker/__main__.py b/searx/search/checker/__main__.py index e1de860b7..4ce4ca76b 100644 --- a/searx/search/checker/__main__.py +++ b/searx/search/checker/__main__.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-module-docstring, missing-function-docstring +# pylint: disable=missing-module-docstring import sys import io diff --git a/searx/search/checker/background.py b/searx/search/checker/background.py index f79a5d2df..d9f11a71c 100644 --- a/searx/search/checker/background.py +++ b/searx/search/checker/background.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-module-docstring, missing-function-docstring +# pylint: disable=missing-module-docstring import json import random diff --git a/searx/search/processors/abstract.py b/searx/search/processors/abstract.py index 81724f052..c8d81c026 100644 --- a/searx/search/processors/abstract.py +++ b/searx/search/processors/abstract.py @@ -19,8 +19,6 @@ from searx.utils import get_engine_from_settings logger = logger.getChild('searx.search.processor') SUSPENDED_STATUS = {} -# pylint: disable=missing-function-docstring - class SuspendedStatus: """Class to handle suspend state.""" diff --git a/searx/search/processors/online_currency.py b/searx/search/processors/online_currency.py index 4f642fa72..3213a11e5 100644 --- a/searx/search/processors/online_currency.py +++ b/searx/search/processors/online_currency.py @@ -12,8 +12,6 @@ from .online import OnlineProcessor parser_re = re.compile('.*?(\\d+(?:\\.\\d+)?) ([^.0-9]+) (?:in|to) ([^.0-9]+)', re.I) -# pylint: disable=missing-function-docstring - def normalize_name(name): name = name.lower().replace('-', ' ').rstrip('s') name = re.sub(' +', ' ', name) diff --git a/searx/settings_defaults.py b/searx/settings_defaults.py index 42d88f2bc..62625b912 100644 --- a/searx/settings_defaults.py +++ b/searx/settings_defaults.py @@ -1,6 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring """Implementation of the default settings. """ diff --git a/searx/unixthreadname.py b/searx/unixthreadname.py index 9a6f53813..0f1f54936 100644 --- a/searx/unixthreadname.py +++ b/searx/unixthreadname.py @@ -14,7 +14,7 @@ else: old_thread_init = threading.Thread.__init__ def new_thread_init(self, *args, **kwargs): - # pylint: disable=protected-access, disable=c-extension-no-member, disable=missing-function-docstring + # pylint: disable=protected-access, disable=c-extension-no-member old_thread_init(self, *args, **kwargs) setproctitle.setthreadtitle(self._name) threading.Thread.__init__ = new_thread_init diff --git a/searx/version.py b/searx/version.py index daada6020..ac42834d9 100644 --- a/searx/version.py +++ b/searx/version.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring,missing-module-docstring,missing-class-docstring +# pylint: disable=,missing-module-docstring,missing-class-docstring import re import os diff --git a/searx/webapp.py b/searx/webapp.py index e29b7f442..6fcf7c464 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring """WebbApp """