From 32c8a540459f916a17d7972e40178de982487470 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Fri, 9 Oct 2026 20:55:02 +0200 Subject: [PATCH] earned_time 0.5.0: pylint/no-noqa fixes (max-attributes 12 for the Earner record) Co-Authored-By: Claude Opus 5 (1M context) --- earned_time/earned_time/_policy.py | 2 +- earned_time/earned_time/tests/test_tutor_ledger.py | 4 +++- earned_time/pyproject.toml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/earned_time/earned_time/_policy.py b/earned_time/earned_time/_policy.py index 4999b5c..eee00fa 100644 --- a/earned_time/earned_time/_policy.py +++ b/earned_time/earned_time/_policy.py @@ -116,7 +116,7 @@ class Earner: def gaming_for(self, units: int) -> int: """Gaming minutes ``units`` earn, capped at ``max_units``.""" count = self.capped(units) - if count == 0: + if not count: return 0 return self.gaming_minutes + (count - 1) * self.extra_gaming_minutes diff --git a/earned_time/earned_time/tests/test_tutor_ledger.py b/earned_time/earned_time/tests/test_tutor_ledger.py index 6dc3dd5..898dee5 100644 --- a/earned_time/earned_time/tests/test_tutor_ledger.py +++ b/earned_time/earned_time/tests/test_tutor_ledger.py @@ -84,7 +84,9 @@ def test_units_count_blocks_once_and_skip_forgeries( tmp_path: Path, key_file: Path ) -> None: tampered = block("s1", 3, _at(19)) - tampered["detail"] = {**tampered["detail"], "active_seconds": 9000} # type: ignore[dict-item] + detail = tampered["detail"] + assert isinstance(detail, dict) + tampered["detail"] = {**detail, "active_seconds": 9000} rows: list[object] = [ block("s1", 1, _at(18, 15)), block("s1", 2, _at(18, 30)), diff --git a/earned_time/pyproject.toml b/earned_time/pyproject.toml index 8e76ba2..033d32f 100644 --- a/earned_time/pyproject.toml +++ b/earned_time/pyproject.toml @@ -106,7 +106,8 @@ disable = [] [tool.pylint.design] min-public-methods = 0 max-module-lines = 1000 -max-attributes = 10 +# Earner is a frozen registry record: its fields are the policy (cf. music_theory). +max-attributes = 12 [tool.pylint.typecheck] generated-members = [