feat(gitutils): add git_clean to remove untracked files#1229
Conversation
|
Warning Review limit reached
Next review available in: 53 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: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis pull request adds a new Estimated code review effort: 1 (Trivial) | ~3 minutes Related PRsNone identified. Suggested labels: enhancement, tests Suggested reviewers: None identified. Poem 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/fromager/gitutils.py (1)
143-152: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a
versionaddeddirective to the new public function's docstring.
git_cleanis a new public API; per coding guidelines, user-facing changes should carry a Sphinxversionaddeddirective so it's tracked in the changelog/docs.📝 Proposed docstring update
def git_clean(source_dir: pathlib.Path) -> None: """Remove untracked files and directories from a git working tree. Runs ``git clean -xdf`` in *source_dir* to remove all untracked and ignored files, restoring the working tree to a pristine state. + + .. versionadded:: <next-version> """🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/fromager/gitutils.py` around lines 143 - 152, Add a Sphinx versionadded directive to the git_clean function docstring, since this new public API needs to be documented as user-facing. Update the docstring in git_clean to include the appropriate versionadded note alongside the existing summary and behavior description, keeping the public API documentation consistent with the project’s guidelines.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/fromager/gitutils.py`:
- Around line 143-152: Add a Sphinx versionadded directive to the git_clean
function docstring, since this new public API needs to be documented as
user-facing. Update the docstring in git_clean to include the appropriate
versionadded note alongside the existing summary and behavior description,
keeping the public API documentation consistent with the project’s guidelines.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5e2030ee-11c4-4662-ad4b-b031edad18be
📒 Files selected for processing (2)
src/fromager/gitutils.pytests/test_gitutils.py
…ing tree Some projects write files when the PEP 517 hook `prepare_metadata_for_build_wheel` is called, e.g. projects that unconditionally compile code in setup.py. Add a `git_clean` wrapper that runs `git clean -xdf` to restore a working tree to a pristine state after such hooks. Co-Authored-By: Claude <claude@anthropic.com> Signed-off-by: Christian Heimes <cheimes@redhat.com>
|
Tick the box to add this pull request to the merge queue (same as
|
Pull Request Description
What
add
git_cleanto remove untracked files from a working treeWhy
Some projects write files when the PEP 517 hook
prepare_metadata_for_build_wheelis called, e.g. projects that unconditionally compile code in setup.py. Add agit_cleanwrapper that runsgit clean -xdfto restore a working tree to a pristine state after such hooks.