feat: detect Go and Rust during init#34
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: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe CLI's ChangesGo/Rust Starter Rule Scaffolding
Sequence Diagram(s)Skipped — this change is a straightforward extension of existing CLI scaffolding logic with no new multi-component interaction flow. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
|
Thanks! I’ve implemented the Go/Rust detection and starter rules by mirroring the existing catalog BECs, including their patterns, intent/why text, and blocking severity. I also added focused language-detection and starter-rule tests for Go and Rust. I’ll open the PR against |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/becwright/cli.py (1)
213-225: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueConsider word boundaries on the Go/Rust forbid patterns for consistency.
The existing JS rule uses
\bdebugger\bto avoid matchingdebuggeras a substring of a longer identifier. The new Go (panic\s*\() and Rust (dbg!\s*\(,println!\s*\() patterns lack equivalent boundaries, so identifiers likemypanic(ormyeprintln!(could trigger false positives since the pattern is a substring search, not anchored.This is a minor false-positive risk rather than a functional bug, since forbid-based checks already operate on raw line text.
♻️ Optional fix for tighter matching
- check=r"becwright run forbid --pattern 'fmt\.Println\s*\(|panic\s*\('", + check=r"becwright run forbid --pattern '\bfmt\.Println\s*\(|\bpanic\s*\('",- check=r"becwright run forbid --pattern 'dbg!\s*\(|println!\s*\('", + check=r"becwright run forbid --pattern '\bdbg!\s*\(|\bprintln!\s*\('",Note: changing these literal
checkstrings would also require updating the corresponding assertions intests/test_init.py(test_starter_rules_go,test_starter_rules_rust).🤖 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/becwright/cli.py` around lines 213 - 225, The Go and Rust forbid patterns in the starter rules are overly broad and can match substrings inside longer identifiers. Update the `no-debug-go` and `no-debug-rust` rule definitions in `cli.py` to use tighter matching with word-boundary style anchoring or equivalent pattern constraints around the debug/panic tokens, while keeping the intent of forbidding `fmt.Println`, `panic`, `dbg!`, and `println!`. Make sure the corresponding expectations in `tests/test_init.py` (`test_starter_rules_go`, `test_starter_rules_rust`) are updated to match the revised `check` strings.
🤖 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/becwright/cli.py`:
- Around line 213-225: The Go and Rust forbid patterns in the starter rules are
overly broad and can match substrings inside longer identifiers. Update the
`no-debug-go` and `no-debug-rust` rule definitions in `cli.py` to use tighter
matching with word-boundary style anchoring or equivalent pattern constraints
around the debug/panic tokens, while keeping the intent of forbidding
`fmt.Println`, `panic`, `dbg!`, and `println!`. Make sure the corresponding
expectations in `tests/test_init.py` (`test_starter_rules_go`,
`test_starter_rules_rust`) are updated to match the revised `check` strings.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 4b3b34ef-6657-40d8-a59a-4acfc636d465
📒 Files selected for processing (2)
src/becwright/cli.pytests/test_init.py
|
Pulled this down and ran it through its paces — really nice work. 🙌 I spun up throwaway Go, Rust, mixed, and pure-Python repos and The tests are the part I appreciated most: you covered detection, rule generation, and that the YAML actually parses back. That's exactly the kind of thoroughness that makes a PR easy to trust. Thanks for picking this up and seeing it through — this is a real, useful addition and it's landing cleanly. Hope it's the first of many. 🚀 |
|
Thankyou sir...
…On Wed, 1 Jul, 2026, 3:51 am Alonso David De León Rodarte, < ***@***.***> wrote:
Merged #34 <#34> into main.
—
Reply to this email directly, view it on GitHub
<#34?email_source=notifications&email_token=BUV44HUSOCGSARMVVA6LGHL5CQ4NRA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTENZUGAYTEMBVHAYTDJTSMVQXG33OUZQXK5DIN5ZKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#event-27401205811>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BUV44HQ6HHUHQXUYL5JYGWL5CQ4NRAVCNFSNUABGKJSXA33TNF2G64TZHMYTEOBUGY2TSOBYGM5US43TOVSTWNBXHAYDOMRWHE2DNILWAI>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/BUV44HUQ72CZ6IV65KIRKXT5CQ4NRA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTENZUGAYTEMBVHAYTDJTSMVQXG33OUZQXK5DIN5ZKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/BUV44HWRIWQS2ODIVSGI2WT5CQ4NRA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTENZUGAYTEMBVHAYTDJTSMVQXG33OUZQXK5DIN5ZKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
What
Add Go and Rust support to
becwright init..gofiles as Go and.rsfiles as Rustno-debug-goandno-debug-ruststarter rulesWhy
becwright initpreviously detected only Python, JavaScript, and TypeScript. A repository containing only Go or Rust files generated no starter rules.This change keeps
initconsistent with the existing importable Go and Rust catalog BECs.Checklist
pytest)Full suite on Windows:
124 passed, 5 failed. The five failures were present before this change and are related to Windows shell command handling.Summary by CodeRabbit