Skip to content

Linter CLI: Lower --log-level for --only and --all-rules runs - #2006

Merged
marcoroth merged 1 commit into
mainfrom
linter-only-lowers-log-level
Aug 5, 2026
Merged

marcoroth merged 1 commit into
mainfrom
linter-only-lowers-log-level

Conversation

@marcoroth

@marcoroth marcoroth commented Aug 5, 2026 •

Copy link
Copy Markdown
Owner

This pull request updates the linter CLI so that --only and --all-rules lower the effective logLevel for that run, down to the lowest severity that actually came up, so the rules you asked to run always get reported.

Both flags already ignore the rule configuration in .herb.yml to put a specific set of rules in front of you, but the configured logLevel still applied on top of that. Asking for a single rule whose offenses sit below that level produced a run that printed no offenses at all and only accounted for them in the summary:

❯ herb-lint --only html-no-duplicate-ids
✓ Using Herb config file at .herb.yml

 Rule offenses:
  html-no-duplicate-ids (1 offense in 1 file)

 Summary:
  Checked      1 file
  Failing      0 offenses
  Not failing  1 hint (1 offense across 1 file, below --fail-level=error)
  Not shown    1 offense hidden, show it with --log-level=hint
  Fixable      0 offenses
  Rules        1 enabled | filtered by --only

Naming a rule is a stronger signal than the logLevel that keeps everyday runs quiet, so the level now drops to the lowest severity present in the run, and the summary says where that came from:

❯ herb-lint --only html-no-duplicate-ids
✓ Using Herb config file at .herb.yml

app/views/events/_event.html.erb:
  2:5  ⚠ Duplicate ID `event-title` found. IDs must be unique within a document. (html-no-duplicate-ids)

 Rule offenses:
  html-no-duplicate-ids (1 offense in 1 file)

 Summary:
  Checked      1 file
  Failing      0 offenses
  Not failing  1 hint (1 offense across 1 file, below --fail-level=error)
  Log level    hint | lowered from warning by --only
  Fixable      0 offenses
  Rules        1 enabled | filtered by --only

--all-rules gets the same treatment, since the rules it widens the run to are mostly the ones that aren't enabled by default:

  Log level    hint | lowered from warning by --all-rules

Resolves #1980

@github-actions github-actions Bot added documentation Improvements or additions to documentation linter @herb-tools/linter for HTML+ERB templates typescript TypeScript source across the javascript/ packages labels Aug 5, 2026
@marcoroth
marcoroth marked this pull request as ready for review August 5, 2026 01:23
@github-actions

github-actions Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

🌿 Interactive Playground and Documentation Preview

A preview deployment has been built for this pull request. Try out the changes live in the interactive playground:


🌱 Grown from commit b6fd14e


✅ Preview deployment has been cleaned up.

@pkg-pr-new

pkg-pr-new Bot commented Aug 5, 2026

Copy link
Copy Markdown
npx https://pkg.pr.new/@herb-tools/formatter@2006
npx https://pkg.pr.new/@herb-tools/language-server@2006
npx https://pkg.pr.new/@herb-tools/linter@2006

commit: b6fd14e

@marcoroth
marcoroth merged commit 0796d0f into main Aug 5, 2026
22 checks passed
@marcoroth
marcoroth deleted the linter-only-lowers-log-level branch August 5, 2026 01:32

This branch was successfully deployed

1 active deployment
herb-tools (Preview) — b6fd14e0 Deployed Aug 5, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation linter @herb-tools/linter for HTML+ERB templates typescript TypeScript source across the javascript/ packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linter CLI: Running --only should lower --log-level to lowest common severity for that run

1 participant