From 460424a62087e2595a880fc259c1f9d0a97eda12 Mon Sep 17 00:00:00 2001 From: Jussi Kukkonen Date: Wed, 3 Apr 2024 14:33:00 +0300 Subject: [PATCH] lint: Enable flake8-raise I'm not sure I agree with not using the parens in raise SomeError but being consistent is definitely better than not being consistent. Signed-off-by: Jussi Kukkonen --- pyproject.toml | 1 + tuf/ngclient/_internal/trusted_metadata_set.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e2916165..4fe1a036 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,6 +97,7 @@ select = [ "PIE", # flake8-pie "PYI", # flake8-pyi "RET", # flake8-return + "RSE", # flake8-raise "RUF", # ruff-specific rules "S", # flake8-bandit "SIM", # flake8-simplify diff --git a/tuf/ngclient/_internal/trusted_metadata_set.py b/tuf/ngclient/_internal/trusted_metadata_set.py index 09977285..7e4790a3 100644 --- a/tuf/ngclient/_internal/trusted_metadata_set.py +++ b/tuf/ngclient/_internal/trusted_metadata_set.py @@ -240,7 +240,7 @@ def update_timestamp(self, data: bytes) -> Timestamp: ) # Keep using old timestamp if versions are equal. if new_timestamp.version == self.timestamp.version: - raise exceptions.EqualVersionNumberError() + raise exceptions.EqualVersionNumberError # Prevent rolling back snapshot version snapshot_meta = self.timestamp.snapshot_meta