Restore max-attributes 10, drop pylint disables

Group the research-tick test's Steam mocks, the last class over 10.
pylint now rates 10.00 with no inline disables and max-attributes back
at the repo's original 10.

Todo: 9b9342ba

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Krzysztof Rudnicki 2026-11-12 08:40:30 +01:00
parent 749f12ca27
commit 3e53cf3686
3 changed files with 19 additions and 17 deletions

View File

@ -176,11 +176,9 @@ disable = [
[tool.pylint.design] [tool.pylint.design]
min-public-methods = 0 min-public-methods = 0
max-module-lines = 250 max-module-lines = 250
# 15 = the widest persisted record (config.Config). Config, State and # 10, the repo's original value: wider persisted records group their
# PlaytimeState are flat JSON files the live daemon reads and writes; WebGame # fields into nested dataclasses and keep a flat on-disk JSON shape.
# is the UI's row shape. Splitting them under 10 would change the on-disk shape max-attributes = 10
# or hide it behind property forwarders written only for this check.
max-attributes = 15
[tool.pylint.typecheck] [tool.pylint.typecheck]
generated-members = [ generated-members = [

View File

@ -22,6 +22,16 @@ BLOCK = "steam_backlog_enforcer._total_block"
NOW_PATCH = "steam_backlog_enforcer._research_window.now" NOW_PATCH = "steam_backlog_enforcer._research_window.now"
@dataclass
class SteamMocks:
"""The pass's Steam package effects."""
installed: MagicMock
kill: MagicMock
uninstall: MagicMock
purge: MagicMock
@dataclass @dataclass
class Mocks: class Mocks:
"""The collaborators of one pass, all stand-ins.""" """The collaborators of one pass, all stand-ins."""
@ -30,14 +40,11 @@ class Mocks:
reconcile: MagicMock reconcile: MagicMock
launchers: MagicMock launchers: MagicMock
counted: MagicMock counted: MagicMock
steam_installed: MagicMock
enforce: MagicMock enforce: MagicMock
guard: MagicMock guard: MagicMock
notify: MagicMock notify: MagicMock
restore_store: MagicMock restore_store: MagicMock
steam_kill: MagicMock steam: SteamMocks
steam_uninstall: MagicMock
steam_purge: MagicMock
@pytest.fixture @pytest.fixture
@ -63,14 +70,11 @@ def tm(total_block_paths: Paths) -> Iterator[Mocks]:
reconcile, reconcile,
launchers, launchers,
counted, counted,
installed,
enforce, enforce,
guard, guard,
notify, notify,
restore_store, restore_store,
steam_kill, SteamMocks(installed, steam_kill, steam_uninstall, steam_purge),
steam_uninstall,
steam_purge,
) )

View File

@ -72,9 +72,9 @@ class TestOpenWindow:
"""Test that the destructive half of the block stays off.""" """Test that the destructive half of the block stays off."""
window.write_record(make_record()) window.write_record(make_record())
run_pass() run_pass()
tm.steam_kill.assert_not_called() tm.steam.kill.assert_not_called()
tm.steam_uninstall.assert_not_called() tm.steam.uninstall.assert_not_called()
tm.steam_purge.assert_not_called() tm.steam.purge.assert_not_called()
def test_other_launchers_and_counted_games_are_still_killed( def test_other_launchers_and_counted_games_are_still_killed(
self, tm: Mocks self, tm: Mocks
@ -105,7 +105,7 @@ class TestOpenWindow:
self, tm: Mocks self, tm: Mocks
) -> None: ) -> None:
"""Test that the install gap does not scan an absent library.""" """Test that the install gap does not scan an absent library."""
tm.steam_installed.return_value = False tm.steam.installed.return_value = False
window.write_record(make_record()) window.write_record(make_record())
run_pass() run_pass()
tm.enforce.assert_not_called() tm.enforce.assert_not_called()