From bbd2df8c7b7db8f6026a3d9dbe8a8078d14a1850 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sun, 30 Nov 2025 23:43:34 +0100 Subject: [PATCH] fix(lint): fix S603 in engine.py and D100 in conftest.py - Add noqa: S603 for trusted internal C engine subprocess call - Add module docstring to conftest.py - Remove per-file ignores for engine.py and conftest.py from pyproject.toml --- pyproject.toml | 13 ------------- python_pkg/lichess_bot/engine.py | 2 +- python_pkg/lichess_bot/tests/conftest.py | 2 ++ 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6351836..47fd900 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,22 +59,9 @@ unfixable = [] "S607", # Allow partial executable path in tests "PLC0415", # Allow late imports for test isolation ] -"**/conftest.py" = [ - "D100", # Allow missing module docstring - "D103", # Allow missing function docstring -] "poker_modifier_app/poker_modifier_app.py" = [ "FBT003", # Boolean positional values in tkinter API calls ] -"python_pkg/lichess_bot/main.py" = [ - "C901", # Complex functions handling game lifecycle (run_bot, handle_game) - "PLR0912", # Complex nested game event handling with many branches - "PLR0915", # Long function handling complete game lifecycle - "S603", # Subprocess call for analysis script -] -"python_pkg/lichess_bot/engine.py" = [ - "S603", # Subprocess for engine communication -] "python_pkg/keyboard_coop/main.py" = [ "FBT003", # Boolean positional values in pygame API calls (e.g., font.render) ] diff --git a/python_pkg/lichess_bot/engine.py b/python_pkg/lichess_bot/engine.py index b507d0a..d9fab28 100644 --- a/python_pkg/lichess_bot/engine.py +++ b/python_pkg/lichess_bot/engine.py @@ -53,7 +53,7 @@ class RandomEngine: def _call_engine(self, args: list[str], *, timeout: float) -> str: try: - proc = subprocess.run( + proc = subprocess.run( # noqa: S603 - trusted internal C engine binary [self.engine_path, *args], capture_output=True, text=True, diff --git a/python_pkg/lichess_bot/tests/conftest.py b/python_pkg/lichess_bot/tests/conftest.py index cbc08fe..03bad49 100644 --- a/python_pkg/lichess_bot/tests/conftest.py +++ b/python_pkg/lichess_bot/tests/conftest.py @@ -1,3 +1,5 @@ +"""Pytest configuration and fixtures for lichess_bot tests.""" + from pathlib import Path import sys