diff --git a/.ruff.toml b/.ruff.toml index 111d1f8e..80747f8e 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -1,5 +1,5 @@ # https://beta.ruff.rs/docs/rules/ -select = [ +lint.select = [ # rules from pyflakes "F", @@ -112,7 +112,7 @@ select = [ "RUF100", ] -ignore = [ +lint.ignore = [ "COM812", # missing trailing comma, covered by black "ANN101", # ignore missing type annotation in self parameter "S311", # ignore Standard pseudo-random generators because they are not used for cryptographic purposes @@ -122,11 +122,11 @@ fix = true target-version = "py38" -[flake8-tidy-imports] +[lint.flake8-tidy-imports] ## Disallow all relative imports. ban-relative-imports = "all" -[per-file-ignores] +[lint.per-file-ignores] # ignore assert statements in tests "tests/*.py" = ["S101"] diff --git a/django_redis/client/sharded.py b/django_redis/client/sharded.py index dbb1d200..ef03c3a6 100644 --- a/django_redis/client/sharded.py +++ b/django_redis/client/sharded.py @@ -258,7 +258,8 @@ def incr_version(self, key, delta=1, version=None, client=None): raise ConnectionInterrupted(connection=client) from e if value is None: - raise ValueError("Key '%s' not found" % key) + msg = f"Key '{key}' not found" + raise ValueError(msg) if isinstance(key, CacheKey): new_key = self.make_key(key.original_key(), version=version + delta)