1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-22 12:10:11 +01:00

[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 <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2021-09-07 13:34:35 +02:00
parent f0059b80ed
commit 2a3b9a2e26
17 changed files with 20 additions and 27 deletions

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint # lint: pylint
# pylint: disable=missing-function-docstring, missing-module-docstring # pylint: disable=missing-module-docstring
from os.path import dirname, abspath from os.path import dirname, abspath
import logging import logging

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint # lint: pylint
# pylint: disable=missing-module-docstring,missing-function-docstring # pylint: disable=missing-module-docstring
from urllib.parse import urlparse from urllib.parse import urlparse

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint # lint: pylint
# pylint: disable=missing-module-docstring, missing-function-docstring # pylint: disable=missing-module-docstring
import typing import typing
import math import math

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint # lint: pylint
# pylint: disable=missing-module-docstring, missing-function-docstring, global-statement # pylint: disable=missing-module-docstring, global-statement
import asyncio import asyncio
import threading import threading

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint # lint: pylint
# pylint: disable=missing-module-docstring, missing-function-docstring, global-statement # pylint: disable=missing-module-docstring, global-statement
import asyncio import asyncio
import logging import logging

View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint # lint: pylint
# pylint: disable=global-statement # 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 atexit
import asyncio import asyncio

View File

@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint # lint: pylint
# pylint: disable=missing-function-docstring
"""Raise exception for an HTTP response is an error. """Raise exception for an HTTP response is an error.
""" """

View File

@ -117,7 +117,7 @@ class MultipleChoiceSetting(EnumStringSetting):
self._validate_selections(elements) self._validate_selections(elements)
self.value = elements self.value = elements
def parse_form(self, data): # pylint: disable=missing-function-docstring def parse_form(self, data):
if self.locked: if self.locked:
return return
@ -154,7 +154,7 @@ class SetSetting(Setting):
for element in elements: for element in elements:
self.values.add(element) self.values.add(element)
def parse_form(self, data): # pylint: disable=missing-function-docstring def parse_form(self, data):
if self.locked: if self.locked:
return return
@ -226,22 +226,22 @@ class SwitchableSetting(Setting):
if not hasattr(self, 'choices'): if not hasattr(self, 'choices'):
raise MissingArgumentException('missing argument: 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 # pylint: disable=no-self-use
return items return items
def transform_values(self, values): # pylint: disable=missing-function-docstring def transform_values(self, values):
# pylint: disable=no-self-use # pylint: disable=no-self-use
return values return values
def parse_cookie(self, data): # pylint: disable=missing-function-docstring def parse_cookie(self, data):
# pylint: disable=attribute-defined-outside-init # pylint: disable=attribute-defined-outside-init
if data[DISABLED] != '': if data[DISABLED] != '':
self.disabled = set(data[DISABLED].split(',')) self.disabled = set(data[DISABLED].split(','))
if data[ENABLED] != '': if data[ENABLED] != '':
self.enabled = set(data[ENABLED].split(',')) self.enabled = set(data[ENABLED].split(','))
def parse_form(self, items): # pylint: disable=missing-function-docstring def parse_form(self, items):
if self.locked: if self.locked:
return 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('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) 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 disabled = self.disabled
for choice in self.choices: # pylint: disable=no-member for choice in self.choices: # pylint: disable=no-member
if not choice['default_on'] and choice['id'] not in self.enabled: if not choice['default_on'] and choice['id'] not in self.enabled:
disabled.add(choice['id']) disabled.add(choice['id'])
return self.transform_values(disabled) return self.transform_values(disabled)
def get_enabled(self): # pylint: disable=missing-function-docstring def get_enabled(self):
enabled = self.enabled enabled = self.enabled
for choice in self.choices: # pylint: disable=no-member for choice in self.choices: # pylint: disable=no-member
if choice['default_on'] and choice['id'] not in self.disabled: 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) resp.set_cookie(k, v, max_age=COOKIE_MAX_AGE)
return resp return resp
def validate_token(self, engine): # pylint: disable=missing-function-docstring def validate_token(self, engine):
valid = True valid = True
if hasattr(engine, 'tokens') and engine.tokens: if hasattr(engine, 'tokens') and engine.tokens:
valid = False valid = False

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint # lint: pylint
# pylint: disable=missing-module-docstring, missing-function-docstring # pylint: disable=missing-module-docstring
import typing import typing
import threading import threading

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint # lint: pylint
# pylint: disable=missing-module-docstring, missing-function-docstring # pylint: disable=missing-module-docstring
import sys import sys
import io import io

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint # lint: pylint
# pylint: disable=missing-module-docstring, missing-function-docstring # pylint: disable=missing-module-docstring
import json import json
import random import random

View File

@ -19,8 +19,6 @@ from searx.utils import get_engine_from_settings
logger = logger.getChild('searx.search.processor') logger = logger.getChild('searx.search.processor')
SUSPENDED_STATUS = {} SUSPENDED_STATUS = {}
# pylint: disable=missing-function-docstring
class SuspendedStatus: class SuspendedStatus:
"""Class to handle suspend state.""" """Class to handle suspend state."""

View File

@ -12,8 +12,6 @@ from .online import OnlineProcessor
parser_re = re.compile('.*?(\\d+(?:\\.\\d+)?) ([^.0-9]+) (?:in|to) ([^.0-9]+)', re.I) parser_re = re.compile('.*?(\\d+(?:\\.\\d+)?) ([^.0-9]+) (?:in|to) ([^.0-9]+)', re.I)
# pylint: disable=missing-function-docstring
def normalize_name(name): def normalize_name(name):
name = name.lower().replace('-', ' ').rstrip('s') name = name.lower().replace('-', ' ').rstrip('s')
name = re.sub(' +', ' ', name) name = re.sub(' +', ' ', name)

View File

@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint # lint: pylint
# pylint: disable=missing-function-docstring
"""Implementation of the default settings. """Implementation of the default settings.
""" """

View File

@ -14,7 +14,7 @@ else:
old_thread_init = threading.Thread.__init__ old_thread_init = threading.Thread.__init__
def new_thread_init(self, *args, **kwargs): 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) old_thread_init(self, *args, **kwargs)
setproctitle.setthreadtitle(self._name) setproctitle.setthreadtitle(self._name)
threading.Thread.__init__ = new_thread_init threading.Thread.__init__ = new_thread_init

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint # lint: pylint
# pylint: disable=missing-function-docstring,missing-module-docstring,missing-class-docstring # pylint: disable=,missing-module-docstring,missing-class-docstring
import re import re
import os import os

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint # lint: pylint
# pylint: disable=missing-function-docstring
"""WebbApp """WebbApp
""" """