feat(review): Add --list-rules and --emit-summary CLI options#115
Merged
Conversation
`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.
Code Metrics Report
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%)
Reported by octocov |
Schema reviewTip ✅ No risk findings — schema changes look safe to merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
relune review --list-rulesso the rule catalog (rule_id, default severity, description) can be enumerated without a before/after pair; honors--format text|jsononly and rejectsmarkdownas a usage error.relune review --emit-summary <PATH>which always writes the flattened review JSON to PATH alongside the user-visible output, even when--denyshort-circuits the run with rc=10. Reusing the--outpath is rejected as a usage error and the collision check canonicalizes parent directories so logically equivalent paths (./out.jsonvs$PWD/out.json) are caught even when neither file exists yet.Changes
before_input/after_inputarg groups non-required so--list-rulescan run standalone, and surface the catalog throughReviewRuleId::all_metadata()for both text and JSON output.--deny.review --helpsnapshot,docs/cli-reference.md, andskills/relune/SKILL.md.