diff --git a/lms/resources/_js_config/__init__.py b/lms/resources/_js_config/__init__.py index 3294ede0cf..607a998160 100644 --- a/lms/resources/_js_config/__init__.py +++ b/lms/resources/_js_config/__init__.py @@ -51,7 +51,7 @@ def _h_user(self): def _application_instance(self) -> ApplicationInstance: return self._lti_user.application_instance - def add_document_url( # pylint: disable=too-complex,too-many-branches,useless-suppression # noqa: PLR0912 + def add_document_url( # pylint: disable=too-complex,too-many-branches,useless-suppression # noqa: C901, PLR0912 self, document_url ) -> None: """ diff --git a/lms/security.py b/lms/security.py index 36dfa8efbe..bff5fa17da 100644 --- a/lms/security.py +++ b/lms/security.py @@ -93,9 +93,9 @@ def forget(self, request): @staticmethod @lru_cache(maxsize=1) - def get_policy(request: Request): # noqa: PLR0911 + def get_policy(request: Request): # noqa: C901, PLR0911 """Pick the right policy based the request's path.""" - # pylint:disable=too-many-return-statements,too-complex + # pylint:disable=too-many-return-statements path = request.path diff --git a/lms/services/application_instance.py b/lms/services/application_instance.py index 28925e9816..62f1700396 100644 --- a/lms/services/application_instance.py +++ b/lms/services/application_instance.py @@ -196,8 +196,7 @@ def search( # noqa: PLR0913 .all() ) - # pylint: disable=too-complex - def _ai_search_query( # noqa: PLR0913 + def _ai_search_query( # noqa: C901, PLR0913 self, *, id_=None, diff --git a/pyproject.toml b/pyproject.toml index 640de8d84a..5e6b51735e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -106,6 +106,7 @@ disable = [ "protected-access", "singleton-comparison", "unnecessary-lambda-assignment", + "too-complex", # Not supported by ruff "too-many-ancestors", @@ -193,7 +194,6 @@ ignore = [ "PLC1901", "E721", "C414", - "C901", ] [tool.ruff.lint.per-file-ignores] diff --git a/tests/pyproject.toml b/tests/pyproject.toml index 70bbd56f3b..904475dfac 100644 --- a/tests/pyproject.toml +++ b/tests/pyproject.toml @@ -72,8 +72,14 @@ disable = [ # Ported to ruff "unused-argument", + "broad-exception-caught", + "too-many-arguments", + "import-outside-toplevel", + "too-many-statements", "protected-access", + "singleton-comparison", "unnecessary-lambda-assignment", + "too-complex", ] # Just disable PyLint's name style checking for the tests, because we diff --git a/tests/unit/lms/services/canvas_studio_test.py b/tests/unit/lms/services/canvas_studio_test.py index 2e3cf2744a..b0d7f820d6 100644 --- a/tests/unit/lms/services/canvas_studio_test.py +++ b/tests/unit/lms/services/canvas_studio_test.py @@ -341,7 +341,7 @@ def admin_oauth_http_service(self): svc.get.side_effect = self.get_request_handler(is_admin=True) return svc - def get_request_handler(self, collections=None, is_admin=False): # noqa: PLR0915 pylint:disable=too-complex + def get_request_handler(self, collections=None, is_admin=False): # noqa: C901, PLR0915 """ Create a handler for `GET` requests to the Canvas Studio API. @@ -373,7 +373,7 @@ def make_file(id_, title, created_at, with_thumbnail=False): make_collection(10, None, "course_wide", "2024-03-01"), ] - def handler(url, allow_redirects=True): # noqa: PLR0912, PLR0915 + def handler(url, allow_redirects=True): # noqa: C901, PLR0912, PLR0915 api_prefix = "/api/public/v1/" parsed_url = urlparse(url)