Merge pull request #301 from return42/fix-lintrc

[pylint] .pylintrc - disable missing-function-docstring
This commit is contained in:
Alexandre Flament 2021-09-07 15:09:40 +02:00 committed by GitHub
commit e41f78b806
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 32 additions and 61 deletions

View file

@ -59,7 +59,9 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have # --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes # no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W" # --disable=W"
disable=bad-whitespace, duplicate-code disable=bad-whitespace,
duplicate-code,
missing-function-docstring,
# Enable the message, report, category or checker with the given id(s). You can # Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option # either give multiple identifier separated by comma (,) or put this option

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,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
"""This module implements the engine loader. """This module implements the engine loader.
Load and initialize the ``engines``, see :py:func:`load_engines` and register Load and initialize the ``engines``, see :py:func:`load_engines` and register

View file

@ -3,7 +3,7 @@
"""APKMirror """APKMirror
""" """
# pylint: disable=invalid-name, missing-function-docstring # pylint: disable=invalid-name
from urllib.parse import urlencode from urllib.parse import urlencode
from lxml import html from lxml import html

View file

@ -8,8 +8,6 @@ Explore thousands of artworks from The Art Institute of Chicago.
""" """
# pylint: disable=missing-function-docstring
from json import loads from json import loads
from urllib.parse import urlencode from urllib.parse import urlencode

View file

@ -3,7 +3,6 @@
"""CORE (science) """CORE (science)
""" """
# pylint: disable=missing-function-docstring
from json import loads from json import loads
from datetime import datetime from datetime import datetime

View file

@ -3,7 +3,6 @@
""" """
Deviantart (Images) Deviantart (Images)
""" """
# pylint: disable=missing-function-docstring
from urllib.parse import urlencode from urllib.parse import urlencode
from lxml import html from lxml import html

View file

@ -3,7 +3,6 @@
""" """
Digg (News, Social media) Digg (News, Social media)
""" """
# pylint: disable=missing-function-docstring
from json import loads from json import loads
from urllib.parse import urlencode from urllib.parse import urlencode

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
"""Docker Hub (IT) """Docker Hub (IT)
""" """

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
"""DuckDuckGo (Instant Answer API) """DuckDuckGo (Instant Answer API)
""" """

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=invalid-name, missing-function-docstring # pylint: disable=invalid-name
"""Genius """Genius
""" """

View file

@ -3,7 +3,7 @@
""" """
Gigablast (Web) Gigablast (Web)
""" """
# pylint: disable=missing-function-docstring, invalid-name # pylint: disable=invalid-name
import re import re
from json import loads from json import loads

View file

@ -25,8 +25,6 @@ The google WEB engine itself has a special setup option:
""" """
# pylint: disable=invalid-name, missing-function-docstring
from urllib.parse import urlencode from urllib.parse import urlencode
from lxml import html from lxml import html
from searx.utils import match_language, extract_text, eval_xpath, eval_xpath_list, eval_xpath_getindex from searx.utils import match_language, extract_text, eval_xpath, eval_xpath_list, eval_xpath_getindex

View file

@ -11,7 +11,7 @@ ignores some parameters from the common :ref:`google API`:
""" """
# pylint: disable=invalid-name, missing-function-docstring # pylint: disable=invalid-name
import binascii import binascii
from datetime import datetime from datetime import datetime

View file

@ -9,7 +9,7 @@ Definitions`_.
https://developers.google.com/custom-search/docs/xml_results#WebSearch_Query_Parameter_Definitions https://developers.google.com/custom-search/docs/xml_results#WebSearch_Query_Parameter_Definitions
""" """
# pylint: disable=invalid-name, missing-function-docstring # pylint: disable=invalid-name
from urllib.parse import urlencode from urllib.parse import urlencode
from datetime import datetime from datetime import datetime

View file

@ -14,7 +14,7 @@
""" """
# pylint: disable=invalid-name, missing-function-docstring # pylint: disable=invalid-name
import re import re
from urllib.parse import urlencode from urllib.parse import urlencode

View file

@ -4,8 +4,6 @@
""" """
# pylint: disable=missing-function-docstring
import datetime import datetime
from json import loads, dumps from json import loads, dumps

View file

@ -4,7 +4,7 @@
Meilisearch Meilisearch
""" """
# pylint: disable=global-statement, missing-function-docstring # pylint: disable=global-statement
from json import loads, dumps from json import loads, dumps

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
"""MongoDB engine (Offline) """MongoDB engine (Offline)
""" """

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
"""MySQL database (offline) """MySQL database (offline)
""" """

View file

@ -3,7 +3,6 @@
"""OpenStreetMap (Map) """OpenStreetMap (Map)
""" """
# pylint: disable=missing-function-docstring
import re import re
from json import loads from json import loads

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
"""PostgreSQL database (offline) """PostgreSQL database (offline)
""" """

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
"""Redis engine (offline) """Redis engine (offline)
""" """

View file

@ -4,8 +4,6 @@
""" """
# pylint: disable=missing-function-docstring
from json import loads from json import loads
from urllib.parse import urlencode from urllib.parse import urlencode

View file

@ -4,7 +4,7 @@
Solr Solr
""" """
# pylint: disable=global-statement, missing-function-docstring # pylint: disable=global-statement
from json import loads from json import loads
from urllib.parse import urlencode from urllib.parse import urlencode

View file

@ -4,8 +4,6 @@
""" """
# pylint: disable=missing-function-docstring
from datetime import datetime from datetime import datetime
from json import loads from json import loads
from urllib.parse import urlencode from urllib.parse import urlencode

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
"""SQLite database (Offline) """SQLite database (Offline)

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
"""Unsplash """Unsplash
""" """

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
"""The XPath engine is a *generic* engine with which it is possible to configure """The XPath engine is a *generic* engine with which it is possible to configure
engines in the settings. engines in the settings.

View file

@ -6,7 +6,7 @@ Yahoo News is "English only" and do not offer localized nor language queries.
""" """
# pylint: disable=invalid-name, missing-function-docstring # pylint: disable=invalid-name
import re import re
from urllib.parse import urlencode from urllib.parse import urlencode

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
""" """