Repository navigation
fix(findings): make --severity filter and list colouring case-insensitive - #588
Merged
Merged
Conversation
…tive Severities are stored lowercase, but the filter upper-cased its argument (never matching) and the renderer matched uppercase literals (no colour). Lowercase the filter argument, colour via a pure case-insensitive helper, and validate --severity (info|minor|major|critical, any case) in clap. Closes #586 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: ajianaz <ajianaz@users.noreply.github.com>
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.
What
cora findings list --severity <x>now matches regardless of argument case (argument lowercased to match the stored form).severity_color()helper that matches case-insensitively, so colouring actually applies.--severityis validated by clap (info|minor|major|critical, any case); unknown values fail with a clear error instead of silently returning nothing.Why
Severities are stored lowercase, but the filter upper-cased its argument (never matched) and the renderer compared against uppercase literals (colouring dead). Stored data, JSON keys and
statslabels are unchanged. Closes #586Testing
cargo clippy --all-targets --features tree-sitter -- -D warningsclean;cargo fmtapplied.cargo test --features tree-sitter --bin cora -- review_store findings: 82 passed (filter for each case variant, unknown value,severity_color, clap parse accept/reject, stats labels still lowercase).index::/watch::skipped locally (stray flock); CI runs everything.--severity MAJORand--severity majorboth list the major finding;--severity bogusexits 2 withpossible values: info, minor, major, critical;list --jsonunchanged; forced-colour output shows red/yellow/green for critical/major/minor.🤖 Generated with Claude Code