Code hygiene pass #90
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/code-hygiene"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Collects the findings of a full code review into one branch: duplicated logic extracted, pass-throughs and trivial wrappers removed, redundant enum lookups dropped, and docstrings that only re-spell the code deleted.
Each item lands as its own PR into this branch. Merge into main once the list is done and the pipeline is green.
@ -482,0 +377,4 @@self._finish()def _finish(self) -> None:# Cleared before the notify: a listener acting on `settled` must seeThis is hard to read. If it really needs to be here, simplify the prose
@ -66,2 +57,4 @@TOOK = frozenset({"updated", "returned"})"""The updater's words for a session that left the node running something.More poor English
@ -10,2 +10,4 @@from .units import SentinelCONTROL_API_PORT = 8787"""Clear of Home Assistant's 8123, which shares the host's network namespace."""Don't need this comment
@ -54,3 +51,2 @@when: str = ""# Where set, only these values of field `when` put this one on the wire.# What to send, never what to expect: a reader goes by the length it got.# Only these values of `when` put this field on the wire. Encoding only: aWTF does this even mean?
@ -19,3 +18,1 @@Never raised here: only a consumer knows which fields it cannot act without.""""""Never raised here: only a consumer knows which fields it cannot act without."""Surely this wants to be a
passlikePayloadTooLongError?@ -0,0 +1,22 @@"""Looking a raw int up in an `IntEnum`, the bus's one recurring shape.Horrible prose in this comment. Ideally remove it, but at least sort it out
@ -4,3 +1,1 @@one dropped looks like a fault in the van. The bridge's own counts of the busland here too, sharing nothing with the rest but the platform.""""""Everything the van measures, and everything it says nothing useful about."""What does this even mean?!
@ -54,3 +43,1 @@A total stays true with the interface down — it is what happened before itwent — and that is exactly when someone is reading it.""""""Stays available with the interface down: it is what happened before it went."""This makes no sense
@ -1,4 +1,7 @@"""What the Pi can see of the bus, counted rather than interpreted.""""""What the Pi can see of the bus, counted rather than interpreted.This is a shit comment. Rewrite it in simpler English
@ -1,4 +1,7 @@"""What the Pi can see of the bus, counted rather than interpreted.""""""What the Pi can see of the bus, counted rather than interpreted.No payload is decoded here: a second decoder is a second chance to drift.Why was this added? It should be clear reading the code that this isn't decoding
@ -168,3 +147,1 @@Missing is what has spoken this run and since gone quiet: nothing elsesays what the van ought to have, and a board taken out is not missing.""""""Missing spoke this run and went quiet since; a board taken out has not."""Unintelligible
WIP: Code hygiene passto Code hygiene pass