Skip to content

Change ERB=>Ruby Processing Strategy#70

Open
ccutrer wants to merge 1 commit into
r7kamura:mainfrom
ccutrer:extract-all-ruby-simplified
Open

Change ERB=>Ruby Processing Strategy#70
ccutrer wants to merge 1 commit into
r7kamura:mainfrom
ccutrer:extract-all-ruby-simplified

Conversation

@ccutrer

@ccutrer ccutrer commented Jun 10, 2026

Copy link
Copy Markdown

Instead of putting each ERB node into "separate" Ruby blocks for feeding to RuboCop, use Herb.extract_ruby. This means we don't need to strip out statements split across multiple ERB tags, or ignore Lint/Syntax.

But we need to prevent any regular RuboCop autocorrects from breaking non-Ruby characters in an ERB file.

Many more cops that would now have false positives without knowing that the ERB content exists (such as not knowing about the bodies of conditionals, or that ERB output is not void), or warn about the resulting Ruby from Herb.extract_ruby (mostly the semicolons), have been disabled. They'll be re-enabled in future PRs that will make them aware of the ERB context.

Instead of putting each ERB node into "separate" Ruby blocks for
feeding to RuboCop, use `Herb.extract_ruby`. This means we don't
need to strip out statements split across multiple ERB tags, or
ignore Lint/Syntax.

But we need to prevent any regular RuboCop autocorrects from
breaking non-Ruby characters in an ERB file.

Many more cops that would now have false positives without knowing
that the ERB content exists (such as not knowing about the bodies
of conditionals, or that ERB output is not void), or warn about
the resulting Ruby from `Herb.extract_ruby` (mostly the semicolons),
have been disabled. They'll be re-enabled in future PRs that will
make them aware of the ERB context.
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