Format long ERB lines
lcampanari opened this issue ยท 4 comments
Hey, thanks for this gem!
The readme says "attempts to limit length (configurable)". How can I configure that?
I tried running the following case in the command line
erb-formatter/test/erb/test_formatter.rb
Lines 126 to 136 in a710ec2
with
echo "<div> <%=render MyComponent.new(foo:barbarbarbarbarbarbarbar,bar:bazbazbazbazbazbazbazbaz, baz:bahbahbahbahbahbahbahbabahbahbahbah, bah: fozfozfozfozfozfozfozfofzofzofzofozfozfozofz)%> </div>" | erb-format --stdin
and the result was
<div>
<%= render MyComponent.new(foo:barbarbarbarbarbarbarbar,bar:bazbazbazbazbazbazbazbaz, baz:bahbahbahbahbahbahbahbabahbahbahbah, bah: fozfozfozfozfozfozfozfofzofzofzofozfozfozofz) %>
</div>
Is there anything I need to do in order to format long embedded ruby lines?
For now it can only be passed when used directly in Ruby (see below), but ideally there should be a CLI flag to set that number.
Happy to review a PR if you want to take up the challenge ๐
https://github.com/nebulab/erb-formatter/blob/main/lib/erb/formatter.rb#L77
NVM, I misread the issue, I think you can try the master version, which should contain a fix for that.
We'll release soon, so if that works just close this issue and wait for the update! Thanks for your patience ๐