diff --git a/PYTHON/extractLinks/main.py b/PYTHON/extractLinks/main.py index 2007968..a73cc49 100755 --- a/PYTHON/extractLinks/main.py +++ b/PYTHON/extractLinks/main.py @@ -25,7 +25,7 @@ class _HrefParser(HTMLParser): self.hrefs: list[str] = [] def handle_starttag( # type: ignore[override] - self, tag: str, attrs: list[tuple[str, str | None]] + self, _tag: str, attrs: list[tuple[str, str | None]] ) -> None: """Collect href attributes from start tags.""" for k, v in attrs: diff --git a/PYTHON/lichess_bot/lichess_api.py b/PYTHON/lichess_bot/lichess_api.py index 2ecf503..293540d 100644 --- a/PYTHON/lichess_bot/lichess_api.py +++ b/PYTHON/lichess_bot/lichess_api.py @@ -176,7 +176,7 @@ class LichessAPI: r = self._request("POST", url, timeout=30) r.raise_for_status() - def get_game_state(self, game_id: str) -> dict | None: + def get_game_state(self, _game_id: str) -> dict | None: """Deprecated: use stream_game_events in a persistent loop.""" return None diff --git a/PYTHON/lichess_bot/main.py b/PYTHON/lichess_bot/main.py index f12f0a9..fb09632 100644 --- a/PYTHON/lichess_bot/main.py +++ b/PYTHON/lichess_bot/main.py @@ -17,7 +17,7 @@ from PYTHON.lichess_bot.lichess_api import LichessAPI from PYTHON.lichess_bot.utils import backoff_sleep, get_and_increment_version -def run_bot(log_level: str = "INFO", decline_correspondence: bool = False) -> None: +def run_bot(log_level: str = "INFO", *, decline_correspondence: bool = False) -> None: """Start the bot and listen for incoming events.""" logging.basicConfig( level=getattr(logging, log_level.upper(), logging.INFO), @@ -465,7 +465,7 @@ def main() -> None: help="Decline correspondence challenges", ) args = parser.parse_args() - run_bot(args.log_level, args.decline_correspondence) + run_bot(args.log_level, decline_correspondence=args.decline_correspondence) if __name__ == "__main__": diff --git a/PYTHON/lichess_bot/tests/conftest.py b/PYTHON/lichess_bot/tests/conftest.py index 2cbfd23..cb1522a 100644 --- a/PYTHON/lichess_bot/tests/conftest.py +++ b/PYTHON/lichess_bot/tests/conftest.py @@ -11,7 +11,7 @@ if ROOT not in sys.path: sys.path.insert(0, ROOT) -def pytest_ignore_collect(collection_path: Path, config: pytest.Config) -> bool | None: +def pytest_ignore_collect(collection_path: Path, _config: pytest.Config) -> bool | None: """Ignore per-game blunder test files; keep only the unified one. This lets us keep historical files in the repo without collecting them. diff --git a/PYTHON/screen_locker/screen_lock.py b/PYTHON/screen_locker/screen_lock.py index 859775c..8c958b8 100755 --- a/PYTHON/screen_locker/screen_lock.py +++ b/PYTHON/screen_locker/screen_lock.py @@ -26,7 +26,7 @@ MAX_WEIGHT_KG = 500 class ScreenLocker: """Screen locker that requires workout logging to unlock.""" - def __init__(self, demo_mode: bool = True) -> None: + def __init__(self, *, demo_mode: bool = True) -> None: """Initialize screen locker with optional demo mode.""" # Set up log file path script_dir = os.path.dirname(os.path.abspath(__file__)) diff --git a/PYTHON/stockfish_analysis/analyze_chess_game.py b/PYTHON/stockfish_analysis/analyze_chess_game.py index a7e439e..bea116c 100755 --- a/PYTHON/stockfish_analysis/analyze_chess_game.py +++ b/PYTHON/stockfish_analysis/analyze_chess_game.py @@ -86,7 +86,7 @@ def extract_pgn_text(raw: str) -> str | None: def score_to_cp( - score: chess.engine.PovScore, pov_white: bool + score: chess.engine.PovScore, *, pov_white: bool ) -> tuple[int | None, int | None]: """Return tuple (cp, mate_in) from a PovScore for the given POV color. diff --git a/pyproject.toml b/pyproject.toml index 6cae21b..e65f574 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,11 +39,6 @@ ignore = [ "BLE001", # Blind except - will fix critical ones manually "S603", # subprocess without shell - known pattern "S607", # start-process with partial path - acceptable - "FBT001", # Boolean positional arg - common pattern - "FBT002", # Boolean default value - common pattern - "FBT003", # Boolean positional value - common pattern - "ARG001", # Unused function argument - often needed for API compatibility - "ARG002", # Unused method argument - often needed for API compatibility "N803", # invalid-argument-name - chess notation uses uppercase "N999", # invalid-module-name - PYTHON folder name "LOG015", # root-logger-call - common in scripts @@ -99,6 +94,15 @@ unfixable = [] "PYTHON/randomize_numbers/random_digits.py" = [ "PERF203", # Try-except needed for parsing user input in loop ] +"PYTHON/keyboardCoop/main.py" = [ + "FBT003", # Boolean positional values in pygame API calls (e.g., font.render) +] +"PYTHON/screen_locker/screen_lock.py" = [ + "FBT003", # Boolean positional values in tkinter API calls +] +"poker-modifier-app/poker_modifier_app.py" = [ + "FBT003", # Boolean positional values in tkinter API calls +] [tool.ruff.lint.pydocstyle] convention = "google" # Use Google docstring convention