Harden local type checking and test mocking
Status from this message: Applied, thanks!
Get series with b4
b4 am [email protected] change-id 20260410-harden-type-checking-e92ed8b4cac1Versions newest first
- v2 Latest14 patches 3 repliesApplied
- v114 patches 7 repliesSuperseded
Changes in v2 from the cover letter
- Replace b4 CI integration with simple shell script.
- Fix placement of test docstrings.
- Fix from_git_config(cache_dir=None).
- Add missing spaces in README.md.
- Fix b4 send-prefixes.
- Link to v1: https://patch.msgid.link/[email protected]
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/14 | Add ci script and mypy suppressionsci.sh pyproject.toml | +20 | 0 replies | |
| 2/14 | Type make_msg and drop test suppressionspyproject.toml tests/ tests/ +4 more | +140 | 0 replies | |
| 3/14 | Add ruff import checks to b4 CIci.sh pyproject.toml src/ +8 more | +8 | 0 replies | |
| 4/14 | Add ruff format check to CIci.sh pyproject.toml src/ +11 more | +395 | 0 replies | |
| 5/14 | Add pyright strict checks to CIci.sh pyproject.toml src/ +1 more | +18 | 0 replies | |
| 6/14 | Replace HTTP session mocks with responsespyproject.toml tests/ tests/ +2 more | +1097 | 0 replies | |
| 7/14 | Add ty checks to CIci.sh pyproject.toml src/ +2 more | +26 | 0 replies | |
| 8/14 | Drop redundant read-only property testtests/ | +0 | 0 replies | |
| 9/14 | Type from_git_config keyword argumentspyproject.toml src/ | +17 | 0 replies | |
| 10/14 | Add authheaders stub and typed callablesrc/ tests/ typings/ | +50 | 0 replies | |
| 11/14 | Replace batch mocks with subclassestests/ | +51 | 0 replies | |
| 12/14 | Use CompletedProcess in git config teststests/ | +45 | 0 replies | |
| 13/14 | Update README for uv-based dev checksREADME.md | +7 | 0 replies | |
| 14/14 | Add b4 send configuration.b4-config | +7 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 00/14] Harden local type checking and test mocking
This series raises the local quality floor by making the type-checking tooling stricter and by removing test patterns that rely on unsafe or poorly typed mocks.
It starts by wiring the repository into b4 CI checks, then adds ruff, pyright, and ty so the same checks run consistently in one place. After that, it removes suppressions incrementally by making the code and tests more explicit and better typed: typed keyword forwarding in from_git_config, a typed authheaders integration, and test-local subclasses instead of method reassignment.
The goal is to keep each change reviewable on its own while moving the tree toward a stricter baseline with fewer exceptions and less fragile mocking.
It would be nice to reduce or remove the use of patch entirely, but this series stops short of that since it would require significant restructuring.
The final commit adds the minimal b4 configuration needed to send this series. :)
---
Changes in v2:
- Replace b4 CI integration with simple shell script.
- Fix placement of test docstrings.
- Fix from_git_config(cache_dir=None).
- Add missing spaces in README.md.
- Fix b4 send-prefixes.
- Link to v1: https://patch.msgid.link/[email protected]
---
Tamir Duberstein (14):
Add ci script and mypy suppressions
Type make_msg and drop test suppressions
Add ruff import checks to b4 CI
Add ruff format check to CI
Add pyright strict checks to CI
Replace HTTP session mocks with responses
Add ty checks to CI
Drop redundant read-only property test
Type from_git_config keyword arguments
Add authheaders stub and typed callable
Replace batch mocks with subclasses
Use CompletedProcess in git config tests
Update README for uv-based dev checks
Add b4 send configuration
.b4-config | 7 + README.md | 11 +- ci.sh | 10 + pyproject.toml | 25 +- src/liblore/__init__.py | 2 +- src/liblore/node.py | 104 +- src/liblore/utils.py | 89 +- tests/conftest.py | 90 +- tests/test_auth_headers.py | 83 +- tests/test_cache.py | 214 ++-- tests/test_email_utils.py | 63 +- tests/test_formatting.py | 324 +++--- tests/test_mbox.py | 7 +- tests/test_message.py | 11 +- tests/test_node.py | 1999 +++++++++++++++++++++----------------- tests/test_thread.py | 35 +- typings/authheaders/__init__.pyi | 13 + 17 files changed, 1809 insertions(+), 1278 deletions(-)
---
base-commit: 1c0b653bdb6eeb95625e99419d4b34d31cb55c99
change-id: 20260410-harden-type-checking-e92ed8b4cac1
Best regards,
Signature · 1 line
Tamir Duberstein <[email protected]>