From e348e8fbf5b2d18b420ed007be792d4e44ace50c Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 7 Aug 2024 13:58:54 -0400 Subject: [PATCH] Apply Ruff's flake8-raise (RSE) rules --- membershipworks/membershipworks_api.py | 6 +++--- pyproject.toml | 22 +++++++++++++++++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/membershipworks/membershipworks_api.py b/membershipworks/membershipworks_api.py index c70c42d..8d62f1f 100644 --- a/membershipworks/membershipworks_api.py +++ b/membershipworks/membershipworks_api.py @@ -112,7 +112,7 @@ class MembershipWorks: def _inject_auth(self, kwargs): # TODO: should probably be a decorator or something if self.auth_token is None: - raise NotAuthenticatedError() + raise NotAuthenticatedError # add auth token to params if "params" not in kwargs: kwargs["params"] = {} @@ -135,7 +135,7 @@ class MembershipWorks: in all.js. """ if not self.org_info: - raise NotAuthenticatedError() + raise NotAuthenticatedError fields = staticFlags.copy() # TODO: this will take the later option, if the same field @@ -159,7 +159,7 @@ class MembershipWorks: This is terrible, and there might be a better way to do this. """ if not self.org_info: - raise NotAuthenticatedError() + raise NotAuthenticatedError ret: dict[str, Any] = {"folders": {}, "levels": {}, "addons": {}, "labels": {}} for dek in self.org_info["dek"]: diff --git a/pyproject.toml b/pyproject.toml index 1c96d4a..39ece58 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,27 @@ admin_email = "cmsmanage.django_q2_admin_email_reporter:AdminEmailReporter" line-length = 88 [tool.ruff.lint] -select = ["E4", "E7", "E9", "F", "I", "C4", "UP", "PERF", "PL", "SIM", "FIX003", "DJ012", "A", "INP", "ISC", "Q", "PIE", "LOG"] +select = [ + "E4", + "E7", + "E9", + "F", + "I", + "C4", + "UP", + "PERF", + "PL", + "SIM", + "FIX003", + "DJ012", + "A", + "INP", + "ISC", + "Q", + "PIE", + "LOG", + "RSE", +] ignore = ["ISC001"] [tool.ruff.lint.isort]