feat: JSON Schema for .bec/rules.yaml — editor autocompletion and early validation#80
Conversation
|
Warning Review limit reached
Next review available in: 40 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 (6)
✨ 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 |
…ly validation Closes #29. - schema/rules.schema.json (draft-07): mirrors the frozen schema_version-1 field set exactly — the nine rule fields, the severity/target enums, and additionalProperties: false so a typo (pathss:, severity: blockng) is flagged in the editor instead of surfacing at commit time. - becwright init now writes a '# yaml-language-server: $schema=…' first line, so VS Code's YAML extension and JetBrains IDEs pick the schema up with zero setup; one hand-added line gives pre-existing files the same. - Tests validate the schema itself, the starter rules init generates, this repo's own dogfood rules, and that the typo/enum/missing-check cases fail. jsonschema is a test-only dev extra (runtime still depends on pyyaml alone); the tests importorskip it. - usage.md (+es) documents the editor setup.
e5ac000 to
141c758
Compare
What
Closes #29 (pulled forward from the v1.2 milestone — it is the highest-leverage rule-writing DX gap: today a typo in
rules.yamlis invisible until a check runs).schema/rules.schema.json(draft-07 for maximum editor compatibility): mirrors the frozenschema_version: 1field set exactly — the nine rule fields, theseverity/targetenums,required: [id, check], andadditionalProperties: falsesopathss:orseverity: blockngget flagged as you type instead of at commit time. Every field carries its doc description, so hover text in the editor teaches the format.becwright initwrites a# yaml-language-server: $schema=…first line — VS Code's YAML extension and JetBrains IDEs pick it up with zero setup. One hand-added line gives any pre-existing rules file the same.Dependency note (calling it out explicitly)
Runtime still depends on
pyyamlalone.jsonschema>=4is added as a test-only dev extra so CI validates the schema against real examples; the testsimportorskipit, so the suite still passes without it. If even a dev-extra addition is unwanted, say so and I'll drop the dependency and keep only the structural tests.Stability
Additive: the schema documents the existing frozen format; the generated file gains one comment line (comments are outside the stable contract).
load_rulesbehavior unchanged.Test plan
init's generated output validates, this repo's own.bec/rules.yamlvalidates