ruff: Fix RUF027 Possible f-string without an `f` prefix.

This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-02-29 17:54:40 -08:00 committed by Tim Abbott
parent 865febb307
commit 553f268b04
4 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@ def fetch_metric(metric_id: str, query: str) -> float:
conn.close()
data = json.loads(raw_bytes)
if data["status"] != "success":
raise Exception("Failed to request {metric_id}: {raw_bytes.decode()}")
raise Exception(f"Failed to request {metric_id}: {raw_bytes.decode()}")
return float(data["data"]["result"][0]["value"][1])

View File

@ -65,7 +65,7 @@ print(f"Most likely version: {likely[0]}")
diff = difflib.unified_diff(
templ[likely[0]].splitlines(keepends=True),
current_contents.splitlines(keepends=True),
fromfile="zulip-server-{version}/zproject/prod_settings_template.py",
fromfile=f"zulip-server-{version}/zproject/prod_settings_template.py",
tofile=current_path,
)

View File

@ -318,7 +318,7 @@ if __name__ == "__main__":
if args.subdomain:
subdomain = args.subdomain.lower()
elif args.production:
subdomain = "{username}-prod"
subdomain = f"{username}-prod"
else:
subdomain = username

View File

@ -196,7 +196,7 @@ class RateLimitTests(ZulipTestCase):
user = self.example_user("cordelia")
RateLimitedUser(user).clear_history()
emails = ["new-email-{n}@zulip.com" for n in range(1, 8)]
emails = [f"new-email-{n}@zulip.com" for n in range(1, 8)]
self.do_test_hit_ratelimits(
lambda: self.api_patch(user, "/api/v1/settings", {"email": emails.pop()}),
)