Closed calebhearth closed 1 year ago
Do you have an example of how this looks with ERB files?
Good point, rubocop -A
doesn't touch ERB files so I didn't have a diff, but this does re-introduce the problem you originally tried to fix. I propose that we disable this rule as well for ERB. The diff when I manually fixed it looked like this:
<%= image_tag("slug.png",
- alt: "it's slimy"
- ) %>
+ alt: "it's slimy"
+ ) %>
Good point,
rubocop -A
doesn't touch ERB files so I didn't have a diff, but this does re-introduce the problem you originally tried to fix. I propose that we disable this rule as well for ERB. The diff when I manually fixed it looked like this:<%= image_tag("slug.png", - alt: "it's slimy" - ) %> + alt: "it's slimy" + ) %>
🤣 I thought so! That was the problem when I initially looked at this. For the record, I favor disabling it on ERB files.
Rather than wasting a bunch of space on indenting with the first argument, use fixed indentation. This is really nice given our line length of 80 as in many cases
with_first_argument
was leading to awkward line breaking.Note that this was originally set in https://github.com/BuoySoftware/guides/pull/66 with the goal of reducing ERB violations, but that we separately excluded erb files from this rule so this change wasn't really needed to match our current style.
Here's an example diff from running
rubocop -A --only Layout/ArgumentAlignment
in Buoy (it's abbreviated):