From 0dada4c2b7b67673385d8a44dc4c23fee53f72e6 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Wed, 22 Apr 2026 00:41:55 -0400 Subject: [PATCH] lint: fix E741 ambiguous variable names and F841 unused variable Co-Authored-By: Claude Sonnet 4.6 --- matrixbot/commands.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/matrixbot/commands.py b/matrixbot/commands.py index 93847a0..55d6bc6 100644 --- a/matrixbot/commands.py +++ b/matrixbot/commands.py @@ -1266,7 +1266,7 @@ async def cmd_hangman(client: AsyncClient, room_id: str, sender: str, args: str) display = _hangman_display(game) wrong = game["wrong_count"] guessed = sorted(game["guessed_letters"]) - wrong_letters = [l for l in guessed if l not in game["word"]] + wrong_letters = [ch for ch in guessed if ch not in game["word"]] plain = ( f"Hangman already in progress!\n" f"{_HANGMAN_STAGES[wrong]}\n" @@ -1370,7 +1370,7 @@ async def cmd_guess(client: AsyncClient, room_id: str, sender: str, args: str): await send_html(client, room_id, plain, html) return - wrong_letters = sorted(l for l in game["guessed_letters"] if l not in word) + wrong_letters = sorted(ch for ch in game["guessed_letters"] if ch not in word) plain = ( f"✅ '{letter.upper()}' is in the word!\n" f"{_HANGMAN_STAGES[game['wrong_count']]}\n" @@ -1389,7 +1389,7 @@ async def cmd_guess(client: AsyncClient, room_id: str, sender: str, args: str): game["wrong_count"] += 1 wrong_count = game["wrong_count"] display = _hangman_display(game) - wrong_letters = sorted(l for l in game["guessed_letters"] if l not in word) + wrong_letters = sorted(ch for ch in game["guessed_letters"] if ch not in word) if wrong_count >= 6: del _HANGMAN_GAMES[room_id] @@ -1598,7 +1598,6 @@ async def cmd_wyr(client: AsyncClient, room_id: str, sender: str, args: str): if hasattr(resp, "event_id"): await send_reaction(client, room_id, resp.event_id, "🅰️") await send_reaction(client, room_id, resp.event_id, "🅱️") - event_id = resp.event_id async def reveal(): await asyncio.sleep(30) @@ -1976,7 +1975,7 @@ async def cmd_debate(client: AsyncClient, room_id: str, sender: str, args: str): against_text = against_part.strip() else: # Fallback: try to split in half - lines = [l.strip() for l in text.split("\n") if l.strip()] + lines = [ln.strip() for ln in text.split("\n") if ln.strip()] mid = len(lines) // 2 for_text = " ".join(lines[:mid]) if lines else "No argument generated." against_text = " ".join(lines[mid:]) if lines else "No argument generated."