Skip to content

Commit bb8dde3

Browse files
committed
Add ERB lint checks using erb-formatter
1 parent 8351058 commit bb8dde3

File tree

6 files changed

+19
-8
lines changed

6 files changed

+19
-8
lines changed

.circleci/config.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,17 @@ jobs:
234234
- checkout
235235
- run: 'bundle install'
236236
- run:
237-
name: Check with rubocop
237+
name: Check Ruby
238238
command: |
239239
bundle exec rubocop --parallel --format junit --out "$PWD/test-results/rubocop-results.xml" --format progress
240+
- run:
241+
name: Check ERB
242+
command: |
243+
# enable recursive globbing with "**"
244+
shopt -s globstar
245+
246+
# we're only interested in errors
247+
bundle exec erb-format **/*.html.erb > /dev/null
240248
- run:
241249
name: Check JavaScript
242250
command: |

.format-erb-ignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sandbox/**
2+
tmp/**
3+
**/generators/**
4+
5+
# this file is using tail `if` checks which are not supported by erb-formatter
6+
backend/app/views/spree/admin/shared/_product_tabs.html.erb

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ group :admin do
5454
end
5555

5656
group :utils do
57+
gem 'erb-formatter', require: false
5758
gem 'pry'
5859
gem 'launchy', require: false
5960
gem 'rubocop', '~> 1', require: false

admin/app/components/solidus_admin/ui/table/component.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
content_tag(:span, "0", "data-#{stimulus_id}-target": "selectedRowsCount"),
104104
" #{t('.rows_selected')}.",
105105
])), colspan: @columns.count - 1) %>
106-
</div>
106+
</tr>
107107
</thead>
108108
<% end %>
109109

backend/app/views/spree/admin/images/_image_row.html.erb

+1-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@
1313
"spree/admin/shared/modal",
1414
target: "modal-image-#{image.id}",
1515
title: image.alt,
16-
content: %{
17-
<div class='align-center'>
18-
#{image_tag(image.url(:large))}
19-
</div>
20-
}.html_safe
16+
content: tag.div(image_tag(image.url(:large)), class: 'align-center')
2117
) %>
2218
</td>
2319

core/app/views/spree/order_mailer/inventory_cancellation_email.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</tr>
2020
<% end %>
2121
</table>
22-
<p>
22+
<p></p>
2323
</td>
2424
<td class="expander"></td>
2525
</tr>

0 commit comments

Comments
 (0)