mirror of https://github.com/zulip/zulip.git
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:
parent
865febb307
commit
553f268b04
|
@ -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])
|
||||
|
||||
|
||||
|
|
|
@ -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,
|
||||
)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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()}),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue