Skip to content

Commit 03d132e

Browse files
committed
ruff: Fix B007 Loop control variable not used within loop body.
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 69aaf69 commit 03d132e

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

tools/deploy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def pack(options: argparse.Namespace) -> None:
4747
zip_file_path = os.path.join(bots_dir, options.botname + ".zip")
4848
zip_file = zipfile.ZipFile(zip_file_path, "w", zipfile.ZIP_DEFLATED)
4949
# Pack the complete bot folder
50-
for root, dirs, files in os.walk(options.path):
50+
for root, _dirs, files in os.walk(options.path):
5151
for file in files:
5252
file_path = os.path.join(root, file)
5353
zip_file.write(file_path, os.path.relpath(file_path, options.path))

zulip/integrations/zephyr/check-mirroring

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ except Exception:
126126

127127
# Subscribe to Zephyrs
128128
zephyr_subs_to_add = []
129-
for stream, test in test_streams:
129+
for stream, _test in test_streams:
130130
if stream == "message":
131131
zephyr_subs_to_add.append((stream, "personal", mit_user))
132132
else:
133133
zephyr_subs_to_add.append((stream, "*", "*"))
134134

135135
actually_subscribed = False
136-
for tries in range(10):
136+
for _tries in range(10):
137137
try:
138138
zephyr_ctypes.check(zephyr_ctypes.ZInitialize())
139139
zephyr_port = c_ushort()
@@ -236,7 +236,7 @@ def receive_zephyrs() -> None:
236236
logger.info("Starting sending messages!")
237237
# Send zephyrs
238238
zsig = "Timothy Good Abbott"
239-
for key, (stream, test) in zhkeys.items():
239+
for key, (stream, _test) in zhkeys.items():
240240
if stream == "message":
241241
zwrite_args = ["zwrite", "-n", "-s", zsig, mit_user]
242242
else:
@@ -261,7 +261,7 @@ receive_zephyrs()
261261
logger.info("Sent Zephyr messages!")
262262

263263
# Send Zulips
264-
for key, (stream, test) in hzkeys.items():
264+
for key, (stream, _test) in hzkeys.items():
265265
if stream == "message":
266266
send_zulip(
267267
{

zulip/integrations/zephyr/zephyr_mirror_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ def subscribed_to_mail_messages() -> bool:
960960
stored_result = os.environ.get("HUMBUG_FORWARD_MAIL_ZEPHYRS")
961961
if stored_result is not None:
962962
return stored_result == "True"
963-
for cls, instance, recipient in parse_zephyr_subs(verbose=False):
963+
for cls, instance, _recipient in parse_zephyr_subs(verbose=False):
964964
if cls.lower() == "mail" and instance.lower() == "inbox":
965965
os.environ["HUMBUG_FORWARD_MAIL_ZEPHYRS"] = "True"
966966
return True

zulip_bots/zulip_bots/bots/chessbot/chessbot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ def guide_with_numbers(board_str: str) -> str:
568568
# newline. From then on, numbers are inserted at newlines.
569569
row_list = list("8" + board_without_whitespace_str)
570570

571-
for i, char in enumerate(row_list):
571+
for i, _char in enumerate(row_list):
572572
# `(i + 1) % 10 == 0` if it is the end of a row, i.e., the 10th column
573573
# since lists are 0-indexed.
574574
if (i + 1) % 10 == 0:

zulip_bots/zulip_bots/game_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ def is_user_not_player(self, user_email: str, message: Dict[str, Any]) -> bool:
766766
def generate_game_id(self) -> str:
767767
id = ""
768768
valid_characters = "abcdefghijklmnopqrstuvwxyz0123456789"
769-
for i in range(6):
769+
for _i in range(6):
770770
id += valid_characters[random.randrange(0, len(valid_characters))]
771771
return id
772772

0 commit comments

Comments
 (0)