[fix] prepare for pylint 2.14.0

Remove issue reported by Pylint 2.14.0:

- no-self-use: has been moved to optional extension [1]
- The refactoring checker now also raises 'consider-using-generator' messages
  for max(), min() and sum(). [2]

.pylintrc:
  - <option name>-hint has been removed since long, Pylint 2.14.0 raises an
    error on invalid options
  - bad-continuation and bad-whitespace have been removed [3]

[1] https://pylint.pycqa.org/en/latest/whatsnew/2/2.14/summary.html#removed-checkers
[2] https://pylint.pycqa.org/en/latest/whatsnew/2/2.14/full.html#what-s-new-in-pylint-2-14-0
[2] https://pylint.pycqa.org/en/latest/whatsnew/2/2.6/summary.html#summary-release-highlights

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2022-06-03 15:41:52 +02:00
parent 658e04077b
commit 2de007138c
12 changed files with 9 additions and 52 deletions

View file

@ -464,7 +464,6 @@ def get_attributes(language):
class WDAttribute:
# pylint: disable=no-self-use
__slots__ = ('name',)
def __init__(self, name):
@ -626,7 +625,6 @@ class WDImageAttribute(WDURLAttribute):
class WDDateAttribute(WDAttribute):
# pylint: disable=no-self-use
def get_select(self):
return '?{name} ?{name}timePrecision ?{name}timeZone ?{name}timeCalendar'.replace('{name}', self.name)

View file

@ -81,7 +81,7 @@ class InfoPage:
MarkdownIt("commonmark", {"typographer": True}).enable(["replacements", "smartquotes"]).render(self.content)
)
def get_ctx(self): # pylint: disable=no-self-use
def get_ctx(self):
"""Jinja context to render :py:obj:`InfoPage.content`"""
def _md_link(name, url):

View file

@ -160,6 +160,7 @@ def get_reliabilities(engline_name_list, checker_results):
# even if there is no exception
reliablity = 0
else:
# pylint: disable=consider-using-generator
reliablity = 100 - sum([error['percentage'] for error in errors if not error.get('secondary')])
reliabilities[engine_name] = {

View file

@ -13,7 +13,7 @@ from typing import Iterable, Tuple
import httpx
import anyio
from .network import get_network, initialize, check_network_configuration
from .network import get_network, initialize, check_network_configuration # pylint:disable=cyclic-import
from .client import get_loop
from .raise_for_httperror import raise_for_httperror

View file

@ -198,7 +198,6 @@ class PluginStore:
self.plugins.append(plugin)
def call(self, ordered_plugin_list, plugin_type, *args, **kwargs):
# pylint: disable=no-self-use
ret = True
for plugin in ordered_plugin_list:
if hasattr(plugin, plugin_type):

View file

@ -18,7 +18,7 @@ from flask_babel import gettext
name = gettext('Search on category select')
description = gettext(
'Perform search immediately if a category selected. ' 'Disable to select multiple categories. (JavaScript required)'
'Perform search immediately if a category selected. Disable to select multiple categories. (JavaScript required)'
)
default_on = True
preference_section = 'ui'

View file

@ -208,11 +208,9 @@ class BooleanChoices:
self.default_choices = dict(choices)
def transform_form_items(self, items):
# pylint: disable=no-self-use
return items
def transform_values(self, values):
# pylint: disable=no-self-use
return values
def parse_cookie(self, data_disabled: str, data_enabled: str):

View file

@ -133,7 +133,7 @@ class Search:
def search_multiple_requests(self, requests):
# pylint: disable=protected-access
search_id = uuid4().__str__()
search_id = str(uuid4())
for engine_name, query, request_params in requests:
th = threading.Thread( # pylint: disable=invalid-name

View file

@ -170,5 +170,5 @@ class EngineProcessor(ABC):
tests.update(self.get_default_tests())
return tests
def get_default_tests(self): # pylint: disable=no-self-use
def get_default_tests(self):
return {}

View file

@ -464,7 +464,7 @@ def to_string(obj: Any) -> str:
if isinstance(obj, str):
return obj
if hasattr(obj, '__str__'):
return obj.__str__()
return str(obj)
return repr(obj)

View file

@ -1048,6 +1048,7 @@ def preferences():
# even if there is no exception
reliablity = 0
else:
# pylint: disable=consider-using-generator
reliablity = 100 - sum([error['percentage'] for error in errors if not error.get('secondary')])
reliabilities[e.name] = {