[PATCH v2 00/14] Harden local type checking and test mocking

Tamir Duberstein <[email protected]>
Newsgroups org.kernel.linux.tools
Message-ID <[email protected]>
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. :)

Signed-off-by: Tamir Duberstein <[email protected]>
---
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,
--  
Tamir Duberstein <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.