It seems this issue might be with the ERB parser better-html.
Thanks for looking.
What should reviewers focus on?
Type of Change
[x] Bugfix
[ ] New feature
[ ] Non-breaking change (a change that doesn't alter functionality - i.e., code refactor, configs, etc.)
Additional Release Notes
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Include any notes here to include in the release description. For example, if you selected "breaking change" above, leave notes on how users can transition to this version.
If no additional notes are necessary, delete this section or leave it unchanged.
What are you trying to accomplish?
Advice on how to approach/fix the failing test reproduction for https://github.com/Shopify/packwerk/issues/278 as suggested.
This isn't a fix, so happy to move this to the issue discussion instead.
What approach did you choose and why?
I'm not sure on the best approach to fix this, so looking for guidance.
This change fails the valid ERB parser test with the error:
For the code added to
valid.erb
in this PR, the ruby code extracted from the erb ast into_ruby_ast
is:Which understandably fails parsing when attempted via prism.
This code works fine in practice, because
ERB
parsing results in the following:It seems this issue might be with the ERB parser
better-html
.Thanks for looking.
What should reviewers focus on?
Type of Change
Additional Release Notes
Include any notes here to include in the release description. For example, if you selected "breaking change" above, leave notes on how users can transition to this version.
If no additional notes are necessary, delete this section or leave it unchanged.
Checklist