test(git): add coverage for git_explain.git subprocess wrappers - #33
Conversation
git.py parses raw git diff/ls-files output (including rename normalization) but had no tests. Cover repo-root/inside-repo checks, staged/unstaged/untracked detection, rename normalization, non-ASCII paths, and the combined-diff / diff-for-paths output shapes. Closes #17
|
Warning Review limit reached
Next review available in: 9 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The lint job's `pip install ruff` had no version pin, decoupled from pyproject.toml's own ruff>=0.8.0. A newer ruff release enables new default-on lint rules, breaking CI on pre-existing code unrelated to this change. Pin to the last known-good version in both places.
Summary
git_explain/git.py(repo-root detection, staged/unstaged/untracked change parsing, rename/copy normalization, diff assembly) had zero test coverage.tests/test_git.pycovering repo-root/inside-repo checks,repo_has_commits, staged/unstaged/untracked detection, rename normalization, non-ASCII paths, and the combined-diff / diff-for-paths output shapes, using real git repos intmp_path(same pattern astests/test_run_apply.py).Cstatus, sinceget_staged_changes()callsgit diff --name-statuswithout-C, so git never actually reports copies through that path today (only renames, which are detected by default in modern git).Test plan
pytest -qruff check ./ruff format --check .Closes #17
(Re-opened as a new PR: the original PR #25 was auto-closed by GitHub when
main's history was rewritten to correct a contributor's commit attribution — this branch is unchanged.)