Skip to content

feat(core): Add ReviewRuleMetadata for review rule catalog#113

Merged
mhiro2 merged 1 commit into
mainfrom
feat/review-rule-metadata
Apr 29, 2026
Merged

feat(core): Add ReviewRuleMetadata for review rule catalog#113
mhiro2 merged 1 commit into
mainfrom
feat/review-rule-metadata

Conversation

@mhiro2

@mhiro2 mhiro2 commented Apr 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add ReviewRuleMetadata and ReviewRuleId::metadata() / ReviewRuleId::all_metadata() so the review rule catalog has a single serializable source of truth for the upcoming relune review --list-rules, WASM bindings, and playground rule legend.
  • Re-export ReviewRuleMetadata from relune-core so downstream crates (relune-app, relune-cli, relune-wasm, playground) can depend on the same shape that lint already exposes via LintRuleMetadata.
  • category is intentionally not part of the metadata yet because the existing lint categories do not map cleanly onto migration risk semantics.

Changes

  • e95eff3 : feat(core): add ReviewRuleMetadata for review rule catalog
    • Introduce ReviewRuleMetadata { rule_id, default_severity, description } next to RiskFinding and add metadata() / all_metadata() helpers on ReviewRuleId
    • Re-export ReviewRuleMetadata from the crate root next to ReviewRuleId, mirroring the LintRuleMetadata placement
    • Cover the new helpers with unit tests for accessor parity, full-rule coverage, and serde round-trip with the risk/<kebab> rule id form

Mirror the lint side by exposing serializable metadata for every review
rule. `ReviewRuleId::metadata()` and `ReviewRuleId::all_metadata()`
become the single source of truth for `relune review --list-rules`,
the WASM bindings, and the playground rule legend so each surface
emits the same `rule_id` / `default_severity` / `description` shape.
The `category` field is intentionally omitted because the lint
categories do not map cleanly onto migration risk semantics.
@mhiro2 mhiro2 self-assigned this Apr 29, 2026
@mhiro2 mhiro2 added the enhancement New feature or request label Apr 29, 2026
@github-actions

Copy link
Copy Markdown

Code Metrics Report

main (9882884) #113 (ab83b8f) +/-
Coverage 94.6% 94.7% +0.0%
Test Execution Time 1m33s 1m33s 0s
Details
  |                     | main (9882884) | #113 (ab83b8f) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          94.6% |          94.7% | +0.0% |
  |   Files             |             81 |             81 |     0 |
  |   Lines             |          36827 |          36858 |   +31 |
+ |   Covered           |          34864 |          34912 |   +48 |
  | Test Execution Time |          1m33s |          1m33s |    0s |

Code coverage of files in pull request scope (85.5% → 94.5%)

Files Coverage +/- Status
crates/relune-core/src/review.rs 94.5% +9.0% modified

Reported by octocov

@github-actions

Copy link
Copy Markdown

Schema review

Tip

✅ No risk findings — schema changes look safe to merge.

@mhiro2
mhiro2 merged commit 436955f into main Apr 29, 2026
6 checks passed
@mhiro2
mhiro2 deleted the feat/review-rule-metadata branch April 29, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant