mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
ruff: Fix FURB122 Use of f.write
in a for loop.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
e8fdae8f7b
commit
f990a1400f
@@ -66,8 +66,7 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
keys = get_mentor_keys(args.username)
|
keys = get_mentor_keys(args.username)
|
||||||
with open(authorized_keys, "a") as f:
|
with open(authorized_keys, "a") as f:
|
||||||
for key in keys:
|
f.writelines(append_key.format(username=args.username, key=key) for key in keys)
|
||||||
f.write(append_key.format(username=args.username, key=key))
|
|
||||||
|
|
||||||
print(f"Successfully added {args.username}'s SSH key!")
|
print(f"Successfully added {args.username}'s SSH key!")
|
||||||
print("Can you let your mentor know that they can connect to this machine with:\n")
|
print("Can you let your mentor know that they can connect to this machine with:\n")
|
||||||
|
@@ -571,8 +571,7 @@ def write_instrumentation_reports(full_suite: bool, include_webhooks: bool) -> N
|
|||||||
var_dir = "var" # TODO make sure path is robust here
|
var_dir = "var" # TODO make sure path is robust here
|
||||||
fn = os.path.join(var_dir, "url_coverage.txt")
|
fn = os.path.join(var_dir, "url_coverage.txt")
|
||||||
with open(fn, "wb") as f:
|
with open(fn, "wb") as f:
|
||||||
for call in calls:
|
f.writelines(orjson.dumps(call, option=orjson.OPT_APPEND_NEWLINE) for call in calls)
|
||||||
f.write(orjson.dumps(call, option=orjson.OPT_APPEND_NEWLINE))
|
|
||||||
|
|
||||||
if full_suite:
|
if full_suite:
|
||||||
print(f"INFO: URL coverage report is in {fn}")
|
print(f"INFO: URL coverage report is in {fn}")
|
||||||
|
@@ -302,8 +302,7 @@ class Runner(DiscoverRunner):
|
|||||||
os.makedirs(os.path.dirname(filepath), exist_ok=True)
|
os.makedirs(os.path.dirname(filepath), exist_ok=True)
|
||||||
with open(filepath, "w") as f:
|
with open(filepath, "w") as f:
|
||||||
if self.parallel > 1:
|
if self.parallel > 1:
|
||||||
for index in range(self.parallel):
|
f.writelines(get_database_id(index + 1) + "\n" for index in range(self.parallel))
|
||||||
f.write(get_database_id(index + 1) + "\n")
|
|
||||||
else:
|
else:
|
||||||
f.write(get_database_id() + "\n")
|
f.write(get_database_id() + "\n")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user