Skip to content

Lint templates with Herb and move to the latest RuboCop - #187

Merged
misabegovic merged 3 commits into
mainfrom
chore/rubocop-and-herb
Oct 14, 2026
Merged

misabegovic merged 3 commits into
mainfrom
chore/rubocop-and-herb

Conversation

@misabegovic

Copy link
Copy Markdown
Owner

Summary

  • RuboCop 1.82.1 to 1.92.0. No new offenses.
  • Herb 0.11 replaces erb_lint and better_html, as chosen on 2026-10-14. Herb parses HTML and ERB together, so it catches HTML validity and accessibility problems erb_lint could not see. CI gains a Node 22 step and runs npm run lint:erb with GitHub annotations; bin/ci runs it too.
  • .herb.yml lints app/ for Action View and fails on errors. Five rules are off, each with its reason written in the file:
    • Two false positives: nested forms through render layout:, and a nested link behind linked:.
    • The href="#" links that Stimulus fills in.
    • tag.attributes and checked toggles.
    • The collection-render style rule, which is a refactor of its own.
  • Real errors from the first run are fixed:
    • The radius <option>s toggle selected through control flow.
    • The cookie banner's <style> moved from <body> to the stylesheet.
    • A place photo has alt text, and the YouTube frame has a title.
    • Two unused form builders are gone.
  • The brain: a new decision, wiki/decisions/herb-lints-erb.md, and the operator's answers of 2026-10-14 under sources/conversations/. AGENTS.md, conventions, the architecture overview and how-we-work now name Herb.

Test plan

  • npm run lint:erb: 0 failing offenses; 34 warnings, info and hints are printed and do not fail the build.
  • bundle exec rubocop --parallel: 306 files, no offenses.
  • bin/rails test: 2459 runs, 5881 assertions, 0 failures, 0 errors, 1 skip.
  • bin/rails test:system: 69 runs, 378 assertions, 0 failures.
  • tabula validate: 53 pages valid.
  • CI runs the new Herb step with Node 22.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JEmikXtNoH7wAg6veTjbyT

misabegovic and others added 3 commits October 14, 2026 11:00
- RuboCop 1.82.1 to 1.92.0; the codebase stays clean.
- Herb 0.11 (`@herb-tools/linter`, pinned) replaces erb_lint and better_html.
  It reads HTML and ERB as one document, so it also checks HTML validity and
  accessibility. CI sets up Node 22 and runs `npm run lint:erb`; bin/ci runs
  it as "Style: ERB".
- .herb.yml lints app/ for the Action View framework and fails on errors.
  Five rules are off, each with its reason in the file: two false positives,
  the href="#" links Stimulus fills in, `tag.attributes` and `checked`
  toggles, and the collection-render style rule.
- The first run's real errors are fixed: the radius options toggle `selected`
  through control flow, the cookie banner's <style> moved from the body to
  the stylesheet, a place photo has alt text and the video frame a title,
  and two unused form builders are gone.
- The brain records the switch (decision herb-lints-erb) and the operator's
  answers of 2026-10-14; AGENTS.md and the architecture pages name Herb.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JEmikXtNoH7wAg6veTjbyT
@misabegovic
misabegovic merged commit da50de4 into main Oct 14, 2026
@misabegovic
misabegovic deleted the chore/rubocop-and-herb branch October 14, 2026 10:02
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