From 74fb9c0816a313c4ce8b0eed4d920c6f0731aeeb Mon Sep 17 00:00:00 2001 From: Emil Telstad <22004178+emilte@users.noreply.github.com> Date: Tue, 22 Jul 2025 18:22:02 +0200 Subject: [PATCH] Add ruff PERF rules. --- pyproject.toml | 2 +- src/genlab_bestilling/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c5de89e2..70e91f45 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -129,7 +129,7 @@ ignore = [ "TRY003", # This doesn't seem too bad. # https://docs.astral.sh/ruff/rules/raise-vanilla-args/ "DJ001" # Nullable string fields does is used a lot in this project. Maybe enable later? # https://docs.astral.sh/ruff/rules/django-nullable-model-string-field/ ] -select = ["E", "W", "I", "F", "UP", "S", "B", "A", "COM", "LOG", "PTH", "Q", "PL", "RUF", "ANN", "PIE", "TC", "TRY", "DJ", "EM", "ISC", "RET", "SIM"] +select = ["E", "W", "I", "F", "UP", "S", "B", "A", "COM", "LOG", "PTH", "Q", "PL", "RUF", "ANN", "PIE", "TC", "TRY", "DJ", "EM", "ISC", "RET", "SIM", "PERF"] [tool.ruff.lint.flake8-annotations] mypy-init-return = true # https://docs.astral.sh/ruff/settings/#lint_flake8-annotations_mypy-init-return diff --git a/src/genlab_bestilling/models.py b/src/genlab_bestilling/models.py index eb66cf38..b31106c6 100644 --- a/src/genlab_bestilling/models.py +++ b/src/genlab_bestilling/models.py @@ -495,7 +495,7 @@ def confirm_order(self, persist: bool = True) -> None: for sample in self.samples.all(): try: sample.has_error # noqa: B018 - except ValidationError: + except ValidationError: # noqa: PERF203 invalid += 1 if invalid > 0: