Conversation
- Add DetectionSeverity to LinterExecutionProgram and LinterExecutionViolation - Add severity to GetDetectionProgramsForPackagesResponse - Add DetectionProgramWithSeverity to active/draft detection program response types - Update existing tests with severity field Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add formatWarning utility for yellow text - Update HumanReadableLogger with severity-based formatting and counts - Update IDELintLogger with severity label - Add tests for both loggers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…or summary spacing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Greptile SummaryThis PR implements severity-based exit codes and filtering for the CLI linter. Previously, any violations caused exit code 1; now only ERROR-severity violations trigger failure, while WARNINGs allow exit code 0. The Key changes:
Issue found:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[CLI: lint command] --> B{--level flag?}
B -->|Yes| C[Parse severity threshold]
B -->|No| D[No filtering]
C --> E[LintHandler]
D --> E
E --> F{--rule specified?}
F -->|Yes| G[LintFilesAgainstRule]
F -->|No| H[LintFilesFromConfig]
G --> I[ExecuteLinterPrograms]
H --> J[Deduplicate programs]
J --> I
I --> K[Violations with severity]
K --> L{--level filter?}
L -->|Yes| M[Filter by severity threshold]
L -->|No| N[All violations]
M --> O[Log filtered violations]
N --> O
O --> P{Has ERROR severity?}
P -->|Yes| Q[Exit code 1]
P -->|No| R[Exit code 0]
style Q fill:#f88
style R fill:#8f8
style M fill:#ff8
style J fill:#8ff
Last reviewed commit: 2fc9f0a |
| if (errorCount > 0) { | ||
| logErrorConsole( | ||
| `❌ Found ${formatBold(String(totalViolationCount))} violation(s) in ${formatBold(String(violations.length))} file(s)`, | ||
| `❌ Found ${formatBold(String(errorCount))} error(s) in ${formatBold(String(violations.length))} file(s)`, | ||
| ); | ||
| } | ||
| if (warningCount > 0) { | ||
| logWarningConsole( | ||
| `⚠️ Found ${formatBold(String(warningCount))} warning(s) in ${formatBold(String(violations.length))} file(s)`, | ||
| ); |
There was a problem hiding this comment.
File count in summary uses total violations.length, which counts all files with any violations, not files with that specific severity. If file A has errors and file B has warnings, both summaries show "2 file(s)".
Consider tracking file counts per severity:
| if (errorCount > 0) { | |
| logErrorConsole( | |
| `❌ Found ${formatBold(String(totalViolationCount))} violation(s) in ${formatBold(String(violations.length))} file(s)`, | |
| `❌ Found ${formatBold(String(errorCount))} error(s) in ${formatBold(String(violations.length))} file(s)`, | |
| ); | |
| } | |
| if (warningCount > 0) { | |
| logWarningConsole( | |
| `⚠️ Found ${formatBold(String(warningCount))} warning(s) in ${formatBold(String(violations.length))} file(s)`, | |
| ); | |
| const filesWithErrors = violations.filter((v) => | |
| v.violations.some((d) => d.severity === DetectionSeverity.ERROR), | |
| ).length; | |
| const filesWithWarnings = violations.filter((v) => | |
| v.violations.some((d) => d.severity === DetectionSeverity.WARNING), | |
| ).length; | |
| if (errorCount > 0) { | |
| logErrorConsole( | |
| `❌ Found ${formatBold(String(errorCount))} error(s) in ${formatBold(String(filesWithErrors))} file(s)`, | |
| ); | |
| } | |
| if (warningCount > 0) { | |
| logWarningConsole( | |
| `⚠️ Found ${formatBold(String(warningCount))} warning(s) in ${formatBold(String(filesWithWarnings))} file(s)`, | |
| ); | |
| } |
|



Explanation
Relates to #
Type of Change
Affected Components
Testing
Test Details:
TODO List
Reviewer Notes