Add ERB lint checks using erb-formatter
This commit is contained in:
parent
83510581ea
commit
bb8dde3b3e
@ -234,9 +234,17 @@ jobs:
|
||||
- checkout
|
||||
- run: 'bundle install'
|
||||
- run:
|
||||
name: Check with rubocop
|
||||
name: Check Ruby
|
||||
command: |
|
||||
bundle exec rubocop --parallel --format junit --out "$PWD/test-results/rubocop-results.xml" --format progress
|
||||
- run:
|
||||
name: Check ERB
|
||||
command: |
|
||||
# enable recursive globbing with "**"
|
||||
shopt -s globstar
|
||||
|
||||
# we're only interested in errors
|
||||
bundle exec erb-format **/*.html.erb > /dev/null
|
||||
- run:
|
||||
name: Check JavaScript
|
||||
command: |
|
||||
|
6
.format-erb-ignore
Normal file
6
.format-erb-ignore
Normal file
@ -0,0 +1,6 @@
|
||||
sandbox/**
|
||||
tmp/**
|
||||
**/generators/**
|
||||
|
||||
# this file is using tail `if` checks which are not supported by erb-formatter
|
||||
backend/app/views/spree/admin/shared/_product_tabs.html.erb
|
1
Gemfile
1
Gemfile
@ -54,6 +54,7 @@ group :admin do
|
||||
end
|
||||
|
||||
group :utils do
|
||||
gem 'erb-formatter', require: false
|
||||
gem 'pry'
|
||||
gem 'launchy', require: false
|
||||
gem 'rubocop', '~> 1', require: false
|
||||
|
@ -103,7 +103,7 @@
|
||||
content_tag(:span, "0", "data-#{stimulus_id}-target": "selectedRowsCount"),
|
||||
" #{t('.rows_selected')}.",
|
||||
])), colspan: @columns.count - 1) %>
|
||||
</div>
|
||||
</tr>
|
||||
</thead>
|
||||
<% end %>
|
||||
|
||||
|
@ -13,11 +13,7 @@
|
||||
"spree/admin/shared/modal",
|
||||
target: "modal-image-#{image.id}",
|
||||
title: image.alt,
|
||||
content: %{
|
||||
<div class='align-center'>
|
||||
#{image_tag(image.url(:large))}
|
||||
</div>
|
||||
}.html_safe
|
||||
content: tag.div(image_tag(image.url(:large)), class: 'align-center')
|
||||
) %>
|
||||
</td>
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<p>
|
||||
<p></p>
|
||||
</td>
|
||||
<td class="expander"></td>
|
||||
</tr>
|
||||
|
Loading…
x
Reference in New Issue
Block a user