Skip to content

Add research comparing marcoroth/herb#2260 with tk0miya/rubocop-herb - #6

Merged
tk0miya merged 1 commit into
mainfrom
research/herb-pr2260
Oct 17, 2026
Merged

tk0miya merged 1 commit into
mainfrom
research/herb-pr2260

Conversation

@tk0miya

@tk0miya tk0miya commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Evaluate the RuboCop plugin proposed in Ruby: Add RuboCop support for Ruby in ERB templates marcoroth/herb#2260 (gems/rubocop-herb at d0323df) and compare it with tk0miya/rubocop-herb 2cf8414 (latest main), both in implementation and in actual runs (research/herb-pr2260.md)
  • Add the reproduction setup and steps (research/repro/herb-pr2260/, new "herb PR #2260" section in research/repro/README.md)

Key findings

  • Both convert the whole template into one position-preserving Ruby source for RuboCop's ruby_extractors API, but the PR blanks out <%= and HTML via Herb.extract_ruby and has no autocorrect guard
  • On 333 real views (rails/rails and kaigionrails/conference-app), rubocop -a changed the HTML of 63 files (59 with new Herb parse errors) with the PR, vs 0 with tk0miya/rubocop-herb. The main causes are Layout/ExtraSpacing (enabled by default) and Lint/Void
  • The PR reports 2,455 offenses vs 992, mostly false positives from Layout/ExtraSpacing, Lint/Void on output tags, and Lint/EmptyBlock on HTML-only blocks
  • tk0miya/rubocop-herb shows a few likely false positives that the PR excludes: Lint/EmptyFile, Naming/FileName, Layout/EmptyLineAfterMagicComment

Reproduction environment

  • herb is the prebuilt 0.11.0 gem from rubygems; the ruby platform is removed from Gemfile.lock, and the steps use BUNDLE_FROZEN=true bundle install, so the herb C extension is never built
  • The PR's gem is loaded from the Bundler git source (glob: gems/rubocop-herb/*.gemspec), pinned to the PR head
  • All numbers in the memo were reproduced by following the documented steps

Notes

  • report.md, switching-decision.md and the existing "rubocop-herb" section of research/repro/README.md still target 6601d3e; this memo targets 2cf8414. Updating them is left for a separate change

🤖 Generated with Claude Code

Evaluate the RuboCop plugin proposed in marcoroth/herb#2260 against
tk0miya/rubocop-herb 2cf8414, and add the reproduction setup. The setup
uses the prebuilt herb 0.11.0 gem and loads the PR's gem from the Bundler
git source, so the herb C extension is never built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tk0miya
tk0miya merged commit da8f8bd into main Oct 17, 2026
@tk0miya
tk0miya deleted the research/herb-pr2260 branch October 17, 2026 01:06
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