Skip to content

chore: enable mypy disallow_untyped_defs for stackvox/#20

Merged
StuBehan merged 1 commit into
mainfrom
chore/stricter-mypy
Apr 30, 2026
Merged

chore: enable mypy disallow_untyped_defs for stackvox/#20
StuBehan merged 1 commit into
mainfrom
chore/stricter-mypy

Conversation

@StuBehan
Copy link
Copy Markdown
Collaborator

Summary

Tightens the mypy bar so every function in `stackvox/` carries explicit param and return annotations. Tests stay on the looser config (`disallow_untyped_defs = false` per existing override) — pytest fixtures and pytest-mock's `mocker` are Any-heavy, and strict bans buy little there.

What it surfaced

Exactly one offender across the whole package: the CoreAudio device-change callback in `_start_device_watcher` had two unannotated ctypes parameters. Both are ignored at runtime — `addrs` is a `POINTER(_PropAddr)` and `data` is a `c_void_p` we don't read because only one property is registered and we re-read the device ID directly. Annotated as `Any` with a comment explaining why we ignore them.

Why bother

Now that the package is fully annotated and `py.typed` ships, downstream type checkers will believe our hints and flag mismatches. The strict-by-default posture means a future contributor can't quietly land a partially-typed module.

Test plan

  • `mypy` clean locally.
  • 73/73 tests still pass.
  • CI passes the same.

Tightens the type bar so every function in stackvox/ has explicit param
and return annotations. Tests stay on the looser config — pytest fixtures
and pytest-mock's mocker are Any-heavy, and strict bans buy little there.

Surfaced exactly one untyped function: the CoreAudio device-change
callback in _start_device_watcher had `addrs` and `data` parameters
without annotations. They're a ctypes.POINTER and a c_void_p we don't
actually read — annotated as `Any` with a comment explaining why we
ignore them.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@StuBehan StuBehan force-pushed the chore/stricter-mypy branch from b1662e2 to 3f6f6a3 Compare April 30, 2026 11:48
@StuBehan StuBehan merged commit a2072af into main Apr 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant