From 492d95665a845a2494b1172ba54c787ea437bdc3 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sun, 30 Nov 2025 23:45:29 +0100 Subject: [PATCH] fix(lint): add PLR2004 to test_*.py per-file ignores Magic values in test assertions are a standard pattern and should be allowed in all test files, not just those in tests/ directories. --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 47fd900..72ad421 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,9 +44,9 @@ ignore = [ fixable = ["ALL"] unfixable = [] -# Per-file ignores for test files +# Per-file ignores [tool.ruff.lint.per-file-ignores] -# Test files - allow test-specific patterns +# Test files - allow test-specific patterns (assert, magic values, subprocess) "**/tests/**/*.py" = [ "S101", # Allow assert in tests "S603", # Allow subprocess calls in tests @@ -58,6 +58,7 @@ unfixable = [] "S310", # Allow URL open in tests "S607", # Allow partial executable path in tests "PLC0415", # Allow late imports for test isolation + "PLR2004", # Allow magic values in tests ] "poker_modifier_app/poker_modifier_app.py" = [ "FBT003", # Boolean positional values in tkinter API calls