Skip to content

docs: add doctests to repos.py and localgit.py helpers (#80) - #83

Merged
tschm merged 2 commits into
mainfrom
rhiza_fix_80_20261008
Oct 8, 2026
Merged

tschm merged 2 commits into
mainfrom
rhiza_fix_80_20261008

Conversation

@tschm

@tschm tschm commented Oct 8, 2026

Copy link
Copy Markdown
Member

Fixes #80.

Done when: repos.py and localgit.py each have at least one doctest that pytest runs, and coverage stays at 100% of lines and branches.

Adds examples, which pytest runs through --doctest-modules, to four pure helpers:

  • repos.resolve_path: ~/x, a relative path, bare ~, and an absolute path that doesn't exist all land under the /host mount
  • repos._declared_forge: normalises case and whitespace, returns None when no forge is declared, and refuses an unknown forge with the exact FleetError text
  • localgit._is_test: shows the test-file conventions (tests/, test_*.py, _test.go, .test.ts) and two near misses (contest.py, testing_utils.py)
  • localgit._fingerprint: keeps the mtime to sub-second precision, the property its comment says matters

_is_test had no docstring until now. No code changed.

Gates

  • prek run --all-files: all hooks pass.
  • mypy (strict): clean.
  • pytest: 465 passed (461 plus 4 doctest blocks), 100% of lines and branches.

🤖 Generated with Claude Code

Closes #80

@tschm
tschm merged commit a30a8fb into main Oct 8, 2026
6 checks passed
@tschm
tschm deleted the rhiza_fix_80_20261008 branch October 8, 2026 13:27
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.

Add doctests to the pure helpers in repos.py and localgit.py

1 participant