mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-28 07:16:53 +05:00
feat: add --limit CLI option for output control
- Add --limit/-l option to limit detailed violation output - Implement limit logic in displayGroupedViolations function - Show warning when violations exceed limit - Works with severity filters (--only-critical, --min-severity) - Extract severity labels and headers to constants - Improve CLI maintainability with SEVERITY_DISPLAY_LABELS and SEVERITY_SECTION_HEADERS
This commit is contained in:
@@ -22,6 +22,7 @@ export const CLI_DESCRIPTIONS = {
|
||||
NO_ARCHITECTURE_OPTION: "Skip architecture checks",
|
||||
MIN_SEVERITY_OPTION: "Minimum severity level (critical, high, medium, low)",
|
||||
ONLY_CRITICAL_OPTION: "Show only critical severity issues",
|
||||
LIMIT_OPTION: "Limit detailed output to specified number of violations per category",
|
||||
} as const
|
||||
|
||||
export const CLI_OPTIONS = {
|
||||
@@ -31,6 +32,21 @@ export const CLI_OPTIONS = {
|
||||
NO_ARCHITECTURE: "--no-architecture",
|
||||
MIN_SEVERITY: "--min-severity <level>",
|
||||
ONLY_CRITICAL: "--only-critical",
|
||||
LIMIT: "-l, --limit <number>",
|
||||
} as const
|
||||
|
||||
export const SEVERITY_DISPLAY_LABELS = {
|
||||
CRITICAL: "🔴 CRITICAL",
|
||||
HIGH: "🟠 HIGH",
|
||||
MEDIUM: "🟡 MEDIUM",
|
||||
LOW: "🟢 LOW",
|
||||
} as const
|
||||
|
||||
export const SEVERITY_SECTION_HEADERS = {
|
||||
CRITICAL: "\n═══════════════════════════════════════════\n🔴 CRITICAL SEVERITY\n═══════════════════════════════════════════",
|
||||
HIGH: "\n═══════════════════════════════════════════\n🟠 HIGH SEVERITY\n═══════════════════════════════════════════",
|
||||
MEDIUM: "\n═══════════════════════════════════════════\n🟡 MEDIUM SEVERITY\n═══════════════════════════════════════════",
|
||||
LOW: "\n═══════════════════════════════════════════\n🟢 LOW SEVERITY\n═══════════════════════════════════════════",
|
||||
} as const
|
||||
|
||||
export const CLI_ARGUMENTS = {
|
||||
|
||||
Reference in New Issue
Block a user