diff --git a/.circleci/config.yml b/.circleci/config.yml index 8aa7c7ccc99..d21be2dc603 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: | diff --git a/.format-erb-ignore b/.format-erb-ignore new file mode 100644 index 00000000000..699c0c0594f --- /dev/null +++ b/.format-erb-ignore @@ -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 diff --git a/Gemfile b/Gemfile index 4ea27540d51..cc686abe521 100644 --- a/Gemfile +++ b/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 diff --git a/admin/app/components/solidus_admin/ui/table/component.html.erb b/admin/app/components/solidus_admin/ui/table/component.html.erb index 736c2ae1ecb..241ce89aa02 100644 --- a/admin/app/components/solidus_admin/ui/table/component.html.erb +++ b/admin/app/components/solidus_admin/ui/table/component.html.erb @@ -103,7 +103,7 @@ content_tag(:span, "0", "data-#{stimulus_id}-target": "selectedRowsCount"), " #{t('.rows_selected')}.", ])), colspan: @columns.count - 1) %> - + <% end %> diff --git a/backend/app/views/spree/admin/images/_image_row.html.erb b/backend/app/views/spree/admin/images/_image_row.html.erb index 2b92012fc14..bb7b2d58091 100644 --- a/backend/app/views/spree/admin/images/_image_row.html.erb +++ b/backend/app/views/spree/admin/images/_image_row.html.erb @@ -13,11 +13,7 @@ "spree/admin/shared/modal", target: "modal-image-#{image.id}", title: image.alt, - content: %{ -
+