feat: becwright doctor + validate — diagnose the setup, lint the rules file#78
Conversation
…s file - `becwright validate`: checks .bec/rules.yaml without running anything — YAML parses, no duplicate rule ids, every `becwright run <name>` resolves to a built-in check; warns on a files rule with no paths. Exit 0/2, consistent with the documented exit-code contract. - `becwright doctor`: one command that answers 'why isn't it working?' — rules-file findings plus hook state: becwright hook installed / foreign hook / missing; detects core.hooksPath overrides (a becwright hook in .git/hooks that git will never run), Husky (.husky/pre-commit with or without becwright) and the pre-commit framework (config with or without the becwright hook), each with the exact fix. FAIL -> exit 2, WARN -> exit 0. - git.py grows hook_state / hooks_path_override / hook_manager helpers (also the groundwork for init to stop installing a dead hook under Husky). - 20 new tests; commands documented in README(+es) and usage(+es).
|
Warning Review limit reached
Next review available in: 47 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 (7)
✨ 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 |
What
Two additive commands from the external-adoption audit (P1 tier). Both resolve the most common 'it doesn't work' reports without a round-trip to an issue.
becwright validateValidates
.bec/rules.yamlwithout running any check — for editors, scripts and CI:RulesErrorpath)becwright run <name>resolves to a real built-in checkfilesrule with nopaths— it can never matchExit codes follow the documented contract:
0valid,2config problem.becwright doctorOne command that answers 'why isn't becwright enforcing?':
validate)core.hooksPathdetection — the silent killer: Husky sets it, git then ignores.git/hooksentirely, and a becwright hook there never runs. Doctor names it and gives the exact fix.becwrightactually in.husky/pre-commit?.pre-commit-config.yaml?FAIL→ exit 2;WARN→ exit 0 with guidance; all green →>>> All good.Groundwork
git.pygrowshook_state/hooks_path_override/hook_manager— shared helpers that a follow-up PR uses soinitstops installing a dead hook under Husky.Stability
Additive only: two new subcommands, no change to existing commands, exit codes,
rules.yaml, bundles or--jsonshapes.Test plan
tests/test_doctor_validate.py(validate ok/missing/unknown-check/dupes/bad-yaml/pathless; doctor healthy/foreign-hook/hooksPath/Husky±becwright/pre-commit-framework±becwright/commit-msg-gap/outside-repo; git helper units)