Prune redundant docstrings in custom_components/campervan #102

Merged
Claude merged 1 commit from chore/prune-restating-comments into refactor/code-hygiene 2026-09-28 07:07:44 +00:00
Collaborator

Delete-only pass over custom_components/campervan/ (including protocol/): removes one-line docstrings and attribute docstrings that only re-spell the name and signature next to them.

Kept anything citing a spec section, explaining a sentinel/unit, or stating a non-obvious rationale or trap (for example protocol/codec.py's decode/decode_wire, protocol/catalogue.py's find, and the override docstrings on _own_reading_arrived). Two available properties (switch.py, button.py) had their one-liner turned into a trailing comment since the reason was worth keeping.

No behavioural change. tools/check passes.

Delete-only pass over `custom_components/campervan/` (including `protocol/`): removes one-line docstrings and attribute docstrings that only re-spell the name and signature next to them. Kept anything citing a spec section, explaining a sentinel/unit, or stating a non-obvious rationale or trap (for example `protocol/codec.py`'s `decode`/`decode_wire`, `protocol/catalogue.py`'s `find`, and the override docstrings on `_own_reading_arrived`). Two `available` properties (`switch.py`, `button.py`) had their one-liner turned into a trailing comment since the reason was worth keeping. No behavioural change. `tools/check` passes.
Prune redundant docstrings in custom_components/campervan
All checks were successful
Lint, type check and test / hassfest (pull_request) Successful in 9s
Lint, type check and test / quality (pull_request) Successful in 1m55s
Lint, type check and test / release (pull_request) Has been skipped
240b299d91
Claude merged commit ae979feaaf into refactor/code-hygiene 2026-09-28 07:07:44 +00:00
Claude deleted branch chore/prune-restating-comments 2026-09-28 07:07:44 +00:00
Claude left a comment

Diff is exactly what it claims to be: docstring/comment deletions only, plus the two available properties turned into # comments and the three trims (coordinator.py __init__, reading_store.py's nodes_heard/async_add_listener/async_add_node_listener). Nothing outside custom_components/campervan/ touched, no renamed symbols, no logic changes.

Spot-checked the deletions against the keep rules: no spec-section citations or sentinel/trap explanations were removed — those are all still present elsewhere (e.g. reports_every's "Spec 9.4" comment, accepts_commands, is_complete, metadata_missing, label(), announce()). Didn't find the #100/#101 mistake (a spec-citing docstring wrongly deleted) repeated here.

Two borderline calls, not blockers:

  • discovery.py Inventory.describe()/present() lost docstrings naming the wire frame (SYS_ENDPOINT_DESC/SYS_ENDPOINT_META) each records. That mapping isn't in the signature, only in the # From SYS_ENDPOINT_DESC./# From SYS_ENDPOINT_META. field comments on Endpoint a few lines up — findable, but worth a glance if you want it explicit at the call site too.
  • sensor.py CampervanTrafficSensor.available's deleted docstring ("a run total does") is the same shape of "always available, and here's why" as the two cases kept as # comments in button.py/switch.py. I'd call it fine to drop since entity_description.run_total names itself, but flagging the inconsistency in treatment.

Couldn't re-run tools/check — the review worktree was removed partway through this session (environment issue on my end, unrelated to the PR). Correctness review here is from the diff/source only, not a fresh test run.

Nothing here blocks merge; would approve if I weren't the PR's own author (Forgejo rejects self-approval).

Diff is exactly what it claims to be: docstring/comment deletions only, plus the two `available` properties turned into `#` comments and the three trims (coordinator.py `__init__`, reading_store.py's `nodes_heard`/`async_add_listener`/`async_add_node_listener`). Nothing outside `custom_components/campervan/` touched, no renamed symbols, no logic changes. Spot-checked the deletions against the keep rules: no spec-section citations or sentinel/trap explanations were removed — those are all still present elsewhere (e.g. `reports_every`'s "Spec 9.4" comment, `accepts_commands`, `is_complete`, `metadata_missing`, `label()`, `announce()`). Didn't find the #100/#101 mistake (a spec-citing docstring wrongly deleted) repeated here. Two borderline calls, not blockers: - `discovery.py` `Inventory.describe()`/`present()` lost docstrings naming the wire frame (`SYS_ENDPOINT_DESC`/`SYS_ENDPOINT_META`) each records. That mapping isn't in the signature, only in the `# From SYS_ENDPOINT_DESC.`/`# From SYS_ENDPOINT_META.` field comments on `Endpoint` a few lines up — findable, but worth a glance if you want it explicit at the call site too. - `sensor.py` `CampervanTrafficSensor.available`'s deleted docstring ("a run total does") is the same shape of "always available, and here's why" as the two cases kept as `#` comments in button.py/switch.py. I'd call it fine to drop since `entity_description.run_total` names itself, but flagging the inconsistency in treatment. Couldn't re-run `tools/check` — the review worktree was removed partway through this session (environment issue on my end, unrelated to the PR). Correctness review here is from the diff/source only, not a fresh test run. Nothing here blocks merge; would approve if I weren't the PR's own author (Forgejo rejects self-approval).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rob/CampervanHomeAssistant!102
No description provided.