Skip to content

feat(review): Add --list-rules and --emit-summary CLI options#115

Merged
mhiro2 merged 1 commit into
mainfrom
feat/review-list-rules-emit-summary
Apr 30, 2026
Merged

feat(review): Add --list-rules and --emit-summary CLI options#115
mhiro2 merged 1 commit into
mainfrom
feat/review-list-rules-emit-summary

Conversation

@mhiro2

@mhiro2 mhiro2 commented Apr 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds relune review --list-rules so the rule catalog (rule_id, default severity, description) can be enumerated without a before/after pair; honors --format text|json only and rejects markdown as a usage error.
  • Adds relune review --emit-summary <PATH> which always writes the flattened review JSON to PATH alongside the user-visible output, even when --deny short-circuits the run with rc=10. Reusing the --out path is rejected as a usage error and the collision check canonicalizes parent directories so logically equivalent paths (./out.json vs $PWD/out.json) are caught even when neither file exists yet.

Changes

  • 9f54fbf : feat(review): add --list-rules and --emit-summary CLI options
    • Make the before_input / after_input arg groups non-required so --list-rules can run standalone, and surface the catalog through ReviewRuleId::all_metadata() for both text and JSON output.
    • Run the review pipeline once and write the structured summary file before the deny short-circuit so CI jobs that read the summary (PR comment generation, dashboards) keep working when the build is gated on --deny.
    • Cover the new flags with integration tests for catalog output, markdown rejection, the deny + emit-summary single-pass flow, and a collision regression for not-yet-existing paths; refresh the review --help snapshot, docs/cli-reference.md, and skills/relune/SKILL.md.

`relune review --list-rules` enumerates the full review rule catalog
(rule_id, default severity, description) sourced from
`ReviewRuleId::all_metadata()`. Honors `--format text|json` only and
rejects `markdown` as a usage error since the catalog has no curated
markdown shape; before/after inputs are no longer required when the
flag is present so it can be invoked standalone for CI / docs
automation pipelines.

`relune review --emit-summary <PATH>` writes the same flattened JSON
payload that `--format json` produces to PATH in addition to the
user-visible output. The summary file is written before the `--deny`
short-circuit so CI jobs that depend on the structured report (PR
comment generation, dashboards) keep getting it even when the user
visible run exits with rc=10. Reusing the same path as `--out` is
rejected as a usage error; collision detection canonicalizes parent
directories so logically equivalent paths (`./out.json` vs
`\$PWD/out.json`) are caught even when neither file exists yet.

Integration tests cover the text/json catalog output, markdown
rejection, the deny + emit-summary single-pass flow, the literal path
collision, and the not-yet-existing path collision regression. The
review --help snapshot is refreshed to include both new flags, and
`docs/cli-reference.md` / `skills/relune/SKILL.md` document the new
options and their CI use cases.
@github-actions

Copy link
Copy Markdown

Code Metrics Report

main (117a6fd) #115 (b31221a) +/-
Coverage 94.7% 94.7% -0.1%
Test Execution Time 1m34s 1m30s -4s
Details
  |                     | main (117a6fd) | #115 (b31221a) |  +/-  |
  |---------------------|----------------|----------------|-------|
- | Coverage            |          94.7% |          94.7% | -0.1% |
  |   Files             |             81 |             81 |     0 |
  |   Lines             |          37109 |          37184 |   +75 |
+ |   Covered           |          35161 |          35229 |   +68 |
+ | Test Execution Time |          1m34s |          1m30s |   -4s |

Code coverage of files in pull request scope (96.1% → 95.9%)

Files Coverage +/- Status
crates/relune-cli/src/cli.rs 88.0% 0.0% modified
crates/relune-cli/src/commands/review.rs 91.3% -1.1% modified
crates/relune-cli/src/config.rs 96.4% +0.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 self-assigned this Apr 30, 2026
@mhiro2 mhiro2 added the enhancement New feature or request label Apr 30, 2026
@mhiro2
mhiro2 merged commit 6c66253 into main Apr 30, 2026
6 checks passed
@mhiro2
mhiro2 deleted the feat/review-list-rules-emit-summary branch April 30, 2026 03:39
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