mirror of
https://github.com/zulip/zulip.git
synced 2025-10-25 00:53:56 +00:00
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:
committed by
Tim Abbott
parent
865febb307
commit
553f268b04
@@ -22,7 +22,7 @@ def fetch_metric(metric_id: str, query: str) -> float:
|
|||||||
conn.close()
|
conn.close()
|
||||||
data = json.loads(raw_bytes)
|
data = json.loads(raw_bytes)
|
||||||
if data["status"] != "success":
|
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])
|
return float(data["data"]["result"][0]["value"][1])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ print(f"Most likely version: {likely[0]}")
|
|||||||
diff = difflib.unified_diff(
|
diff = difflib.unified_diff(
|
||||||
templ[likely[0]].splitlines(keepends=True),
|
templ[likely[0]].splitlines(keepends=True),
|
||||||
current_contents.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,
|
tofile=current_path,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ if __name__ == "__main__":
|
|||||||
if args.subdomain:
|
if args.subdomain:
|
||||||
subdomain = args.subdomain.lower()
|
subdomain = args.subdomain.lower()
|
||||||
elif args.production:
|
elif args.production:
|
||||||
subdomain = "{username}-prod"
|
subdomain = f"{username}-prod"
|
||||||
else:
|
else:
|
||||||
subdomain = username
|
subdomain = username
|
||||||
|
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ class RateLimitTests(ZulipTestCase):
|
|||||||
user = self.example_user("cordelia")
|
user = self.example_user("cordelia")
|
||||||
RateLimitedUser(user).clear_history()
|
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(
|
self.do_test_hit_ratelimits(
|
||||||
lambda: self.api_patch(user, "/api/v1/settings", {"email": emails.pop()}),
|
lambda: self.api_patch(user, "/api/v1/settings", {"email": emails.pop()}),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user