🐛 Run prek from root of target repository#344
Conversation
prek from current working direcoryprek from root of target repository
|
Successfully tested in munich-quantum-toolkit/core#1792. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
Warning Review limit reached
More reviews will be available in 45 minutes and 50 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?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 credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. 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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
Changesprek working directory fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
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.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@src/mqt/templates/render_templates.py`:
- Around line 266-270: The subprocess.run call for prek is passing the full
output_path (which already includes target_dir) while also setting
cwd=target_dir, causing prek to receive a doubly-prefixed path when target_dir
is relative. Fix this by computing the relative path of output_path from
target_dir and passing that relative path to the prek subprocess instead of
passing str(output_path). Use output_path.relative_to(target_dir) to get the
correct relative path argument to pass to the --files option.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 33f00095-6fe0-40fa-809b-e3b79fddc24e
📒 Files selected for processing (2)
CHANGELOG.mdsrc/mqt/templates/render_templates.py
|
@coderabbitai review |
✅ Action performedReview finished.
|
Description
This PR fixes a bug encountered in munich-quantum-toolkit/core#1790. Because
prekis not running from the current directory, it cannot find the pre-commit andrumdlconfigurations in the target repository. This PR fixes this by setting thecwdargument ofsubprocess.run.Checklist
I have added appropriate tests that cover the new/changed functionality.I have updated the documentation to reflect these changes.I have added migration instructions to the upgrade guide (if needed).