quality: strict typing + full docstring coverage across the package#4
Merged
Conversation
- mypy --strict now passes (was 139 errors in 12 files); [tool.mypy] strict = true added to pyproject so it stays that way, with mypy and type stubs in the dev extras - every module, class, function, and method has a Google-style docstring (122 were missing), matching the house style in sun.py - zero runtime behavior change: annotations, narrowing guards, and docstrings only; the 307-test suite is untouched and passing Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A typing + documentation quality pass over the whole
huemanpackage. No runtime behavior changes.mypy --strictis now clean (0 errors across 19 source files; was 139 errors in 12 files).[tool.mypy] strict = trueis added topyproject.tomlso it stays enforced, withmypy,types-requests, andtypes-PyYAMLadded to thedevextras.__init__s — has a Google-style docstring matching the existing house style insun.py(122 were missing). Docstrings were written against the code, documenting contracts (BLOCKED plan semantics, debounce/override behavior, timeslot wrap rules, YAML coercion quirks) rather than restating it.X | Noneunions,collections.abcimports,from __future__ import annotationseverywhere. Zero# type: ignore; only 3cast()calls, all at genuine JSON boundaries with explanatory comments.Behavior safety
This package drives a live daemon, so the pass was constrained to zero behavior change:
assert x is not Nonenarrowing sits only where the old code immediately dereferenced the same value (the failure mode changes fromAttributeErrortoAssertionError; underpython -Oit is byte-for-byte the old behavior).Verification
mypy --strict --no-incremental hueman/→Success: no issues found in 19 source filespytest -q→307 passed🤖 Generated with Claude Code