Fix ruff lint errors across matrixbot (F401, F841, E402)
Lint / Shell (shellcheck) (push) Successful in 11s
Lint / JS (eslint) (push) Successful in 10s
Lint / Python (ruff) (push) Successful in 10s
Lint / Python deps (pip-audit) (push) Successful in 1m10s
Lint / Secret scan (gitleaks) (push) Successful in 5s

Remove unused imports: logging from bot.py and config.py, RoomMessageText/
UnknownEvent from callbacks.py, functools.partial and MAX_INPUT_LENGTH from
commands.py. Rename unused local variables to _ (resp in cmd_ping, symbols in
render_keyboard_plain, guesses_left in two wordle functions). Move wordle import
to top of commands.py to fix E402.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-20 16:54:55 -04:00
parent d2983eca23
commit 86cb78d74d
5 changed files with 6 additions and 11 deletions
+3 -5
View File
@@ -6,16 +6,16 @@ import time
import logging
from collections import Counter
from datetime import datetime
from functools import partial
import aiohttp
from nio import AsyncClient
from utils import send_text, send_html, send_reaction, sanitize_input
from wordle import handle_wordle
from config import (
MAX_DICE_SIDES, MAX_DICE_COUNT, BOT_PREFIX, ADMIN_USERS,
OLLAMA_URL, OLLAMA_MODEL, MAX_INPUT_LENGTH, COOLDOWN_SECONDS,
OLLAMA_URL, OLLAMA_MODEL, COOLDOWN_SECONDS,
MINECRAFT_RCON_HOST, MINECRAFT_RCON_PORT, MINECRAFT_RCON_PASSWORD,
RCON_TIMEOUT, MIN_USERNAME_LENGTH, MAX_USERNAME_LENGTH,
)
@@ -99,7 +99,7 @@ async def cmd_help(client: AsyncClient, room_id: str, sender: str, args: str):
@command("ping", "Check bot latency")
async def cmd_ping(client: AsyncClient, room_id: str, sender: str, args: str):
start = time.monotonic()
resp = await send_text(client, room_id, "Pong!")
_ = await send_text(client, room_id, "Pong!")
elapsed = (time.monotonic() - start) * 1000
# Edit isn't straightforward in Matrix, so just send a follow-up if slow
if elapsed > 500:
@@ -822,8 +822,6 @@ async def cmd_health(client: AsyncClient, room_id: str, sender: str, args: str):
# ---------------------------------------------------------------------------
# Wordle
# ---------------------------------------------------------------------------
from wordle import handle_wordle
@command("wordle", "Play Wordle! (!wordle help for details)")
async def cmd_wordle(client: AsyncClient, room_id: str, sender: str, args: str):