Skip to content

Remove severity levels and add progress reporting - #1

Merged
virolea merged 2 commits into
mainfrom
claude/jev-ruby-linter-qupdg4
Sep 21, 2026
Merged

virolea merged 2 commits into
mainfrom
claude/jev-ruby-linter-qupdg4

Conversation

@virolea

@virolea virolea commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Summary

This PR simplifies the linting model by removing rule severity levels and the --fail-on flag, treating all offenses equally. It also adds progress reporting to show users how many files have been checked while a run is in flight.

Key Changes

  • Removed severity concept: Rules no longer have a severity field (previously error or warning). All offenses are now treated equally for exit status purposes.

    • Removed severity and error? from Rule class
    • Removed --fail-on CLI flag and related logic
    • Simplified Report#exit_status to return 1 if any offenses exist (previously differentiated by severity)
    • Updated formatters to no longer output severity information
  • Added progress reporting: New Progress class displays file checking progress on stderr

    • On terminals: shows an in-place counter (e.g., "Checking 5/12 files") that updates and clears when done
    • In CI/pipes: shows a single line announcement to keep captured output clean
    • Integrated into CLI via with_progress helper that yields progress updates to the runner
    • Runner now accepts an optional block to report progress after each file is checked
  • Configuration validation: Configs that still specify severity in rules are now rejected with a clear error message naming the unknown key

  • Updated documentation and examples: Removed all references to severity levels and --fail-on from README, templates, and test fixtures

Implementation Details

  • Progress counter uses carriage returns (\r) on terminals to redraw in place, with proper width tracking to clear previous output
  • Runner uses a mutex to safely track completion count across worker threads
  • Exit status logic simplified: returns 0 (clean), 1 (offenses), or 2 (failures)
  • All formatters (text, GitHub, JSON) updated to remove severity from output

https://claude.ai/code/session_01UhtJDjXrgmwwet27LAiY5f

virolea and others added 2 commits September 21, 2026 10:21
A full run gave no sign of life until the report printed. The runner now
yields after each file and the CLI draws "Checking 12/42 files" on
stderr, redrawn in place on a terminal and erased when done; off a
terminal it prints one line announcing the run so CI logs and piped
JSON stay clean.

An offense is an offense, so `severity` and `--fail-on` are gone: every
offense fails the run and is a GitHub error annotation. A config that
still sets `severity` is rejected as an unknown key.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhtJDjXrgmwwet27LAiY5f
The first real run flagged every lib file on "does every class or module
have a comment?", with probabilities of 0.09 to 0.41: the model read
"every" literally and counted the undocumented `module Lintus` wrapper.
The rule now asks about the offense ("is there a class without a
comment?") and its criteria say which classes to ignore. The starter
template gets the same treatment, and the README explains the two
lessons: ask about the offense, and name the unit and its exclusions.

The JSON output now lists, per file, the probability every rule gave
it, so a run can be read for confidence and not only for verdicts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhtJDjXrgmwwet27LAiY5f
@virolea
virolea merged commit 93e1ed4 into main Sep 21, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant