diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 352623f8bf449b5a533d84488f1b5cecca4e060f..d70dc57549e841f78918213e56d5b42a0fb6356c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ variables: GIT_SUBMODULE_STRATEGY: normal APT_API_URL: https://packages.cccv.de APT_REPO: uffd - PYLINT_PIN: pylint~=2.10.0 + PYLINT_PIN: pylint~=2.16.2 before_script: - python3 -V diff --git a/.pylintrc b/.pylintrc index f3f5782875309366520961e3879688638a10911e..90cd22f4a43abda1b3cc6547a63e0be3345b86fb 100644 --- a/.pylintrc +++ b/.pylintrc @@ -68,6 +68,8 @@ disable=missing-module-docstring, too-many-ancestors, duplicate-code, redefined-builtin, + superfluous-parens, + consider-using-f-string, # Temporary # 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 @@ -386,13 +388,6 @@ max-line-length=160 # Maximum number of lines in a module. max-module-lines=1000 -# List of optional constructs for which whitespace checking is disabled. `dict- -# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. -# `trailing-comma` allows a space between comma and closing bracket: (a, ). -# `empty-line` allows space-only lines. -no-space-check=trailing-comma, - dict-separator - # Allow the body of a class to be on the same line as the declaration if body # contains single statement. single-line-class-stmt=no @@ -513,5 +508,5 @@ min-public-methods=2 # Exceptions that will emit a warning when being caught. Defaults to # "BaseException, Exception". -overgeneral-exceptions=BaseException, - Exception +overgeneral-exceptions=builtin.BaseException, + builtin.Exception diff --git a/uffd/models/session.py b/uffd/models/session.py index 19fa3ad868af7cc171903692ed0ebdb805bd7974..a594e2314745eef2e1a25559222ffdf761870925 100644 --- a/uffd/models/session.py +++ b/uffd/models/session.py @@ -70,8 +70,7 @@ class DeviceLoginInitiation(db.Model): existing and possibly attacker-controlled code). An initiation code is securly bound to the session that it was created - with by storing both id and secret in the encrypted and authenticated - session cookie.''' + with by storing both id and secret in the authenticated session cookie.''' __tablename__ = 'device_login_initiation' id = Column(Integer(), primary_key=True, autoincrement=True) diff --git a/uffd/password_hash.py b/uffd/password_hash.py index bd941ea1a76befb7575e6435686bec1c7bfa17d1..78d0da474ef3af295830a65e1fa53d092b5cd050 100644 --- a/uffd/password_hash.py +++ b/uffd/password_hash.py @@ -206,7 +206,7 @@ class InvalidPasswordHash: def __init__(self, value=None): self.value = value - # pylint: disable=no-self-use,unused-argument + # pylint: disable=unused-argument def verify(self, password): return False diff --git a/uffd/remailer.py b/uffd/remailer.py index f3ffd0792f59ba7c3f6886c92a100f47a845f8a0..14c42f0a5d40a31df8d2261170444e9f31f1f9dc 100644 --- a/uffd/remailer.py +++ b/uffd/remailer.py @@ -14,8 +14,6 @@ class Remailer: Version 2 of the remailer address format is tolerant to case conversions at the cost of being slightly longer.''' - # pylint: disable=no-self-use - @property def configured(self): return bool(current_app.config['REMAILER_DOMAIN']) diff --git a/uffd/views/api.py b/uffd/views/api.py index d0be61d4c731842edd6167cbde475fe3bd25dc2e..815a4d4fa3905f57aa00bbef8aec9ccd4b1c24d7 100644 --- a/uffd/views/api.py +++ b/uffd/views/api.py @@ -180,7 +180,7 @@ def prometheus_metrics(): from prometheus_client import PLATFORM_COLLECTOR, generate_latest, CONTENT_TYPE_LATEST #pylint: disable=import-outside-toplevel class UffdCollector(): - def collect(self): #pylint: disable=no-self-use + def collect(self): try: uffd_version = str(pkg_resources.get_distribution('uffd').version) except pkg_resources.DistributionNotFound: diff --git a/uffd/views/service.py b/uffd/views/service.py index 374180cae6732000954ae61e6c8c1751b4747c07..f08217a3e291d14dfd61431ac4417cfe42b5818f 100644 --- a/uffd/views/service.py +++ b/uffd/views/service.py @@ -28,7 +28,7 @@ def overview_login_maybe_required(func): return decorator def overview_navbar_visible(): - return get_services(request.user) != [] or admin_acl() + return get_services(request.user) or admin_acl() @bp.route('/services/') @register_navbar(lazy_gettext('Services'), icon='sitemap', blueprint=bp, visible=overview_navbar_visible)