From 137610191055ea454c912eb34efea4a9e6a6a8ad Mon Sep 17 00:00:00 2001 From: Marcos Prieto Date: Mon, 3 Jun 2024 09:34:14 +0200 Subject: [PATCH] Linting fixes after ruff upgrade --- lms/resources/_js_config/__init__.py | 2 +- lms/security.py | 2 +- lms/services/application_instance.py | 2 +- pyproject.toml | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lms/resources/_js_config/__init__.py b/lms/resources/_js_config/__init__.py index 411f0b1e91..9c9b19eae0 100644 --- a/lms/resources/_js_config/__init__.py +++ b/lms/resources/_js_config/__init__.py @@ -49,7 +49,7 @@ def _h_user(self): def _application_instance(self): return self._lti_user.application_instance - def add_document_url( # pylint: disable=too-complex,too-many-branches,useless-suppression # noqa: C901, PLR0912 + def add_document_url( # pylint: disable=too-complex,too-many-branches,useless-suppression # noqa: PLR0912 self, document_url ) -> None: """ diff --git a/lms/security.py b/lms/security.py index 3e55fe9e46..7ab43c6c2e 100644 --- a/lms/security.py +++ b/lms/security.py @@ -93,7 +93,7 @@ def forget(self, request): @staticmethod @lru_cache(maxsize=1) - def get_policy(request: Request): # noqa: C901, PLR0911 + def get_policy(request: Request): # noqa: PLR0911 """Pick the right policy based the request's path.""" # pylint:disable=too-many-return-statements,too-complex diff --git a/lms/services/application_instance.py b/lms/services/application_instance.py index 0a0fa89fd9..31174df43e 100644 --- a/lms/services/application_instance.py +++ b/lms/services/application_instance.py @@ -197,7 +197,7 @@ def search( # noqa: PLR0913 ) # pylint: disable=too-complex - def _ai_search_query( # noqa: C901, PLR0913 + def _ai_search_query( # noqa: PLR0913 self, *, id_=None, diff --git a/pyproject.toml b/pyproject.toml index 64c125b3f8..57c1769cf4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -186,6 +186,7 @@ ignore = [ "PLC1901", "E721", "C414", + "C901", ] [tool.ruff.lint.per-file-ignores]