From 02ac290cb525dd9e5698809fdd507875e7abb3fe Mon Sep 17 00:00:00 2001 From: syed-ali-tw Date: Tue, 6 Aug 2024 16:57:26 +0100 Subject: [PATCH] Add workflow for erb-lint --- .github/workflows/ci.yml | 4 ++++ app/views/homepage/popular_links/_sidebar.html.erb | 4 ++-- lib/tasks/lint.rake | 6 +----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4661da622..3184b094f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,10 @@ jobs: name: Lint Ruby uses: alphagov/govuk-infrastructure/.github/workflows/rubocop.yml@main + lint-erb: + name: Lint Ruby + uses: alphagov/govuk-infrastructure/.github/workflows/erblint.yml@main + test-javascript: name: Test JavaScript uses: alphagov/govuk-infrastructure/.github/workflows/jasmine.yml@main diff --git a/app/views/homepage/popular_links/_sidebar.html.erb b/app/views/homepage/popular_links/_sidebar.html.erb index aa007adec..d488c8feb 100644 --- a/app/views/homepage/popular_links/_sidebar.html.erb +++ b/app/views/homepage/popular_links/_sidebar.html.erb @@ -17,8 +17,8 @@ primary_link_button_for(edit_popular_links_path(@latest_popular_links), "Edit popular links") , secondary_button_for(@latest_popular_links, publish_popular_links_path(@latest_popular_links), "Publish"), link_to("Preview (opens in new tab)", preview_homepage_path(@latest_popular_links), rel:"noreferrer noopener", target:"_blank", class: "govuk-link"), - link_to("Delete draft", confirm_destroy_popular_links_path(@latest_popular_links), class: "govuk-link gem-link--destructive") - ] + link_to("Delete draft", confirm_destroy_popular_links_path(@latest_popular_links), class: "govuk-link gem-link--destructive"), + ], } %> <% end %> diff --git a/lib/tasks/lint.rake b/lib/tasks/lint.rake index 28def6270..0e021eec3 100644 --- a/lib/tasks/lint.rake +++ b/lib/tasks/lint.rake @@ -1,10 +1,6 @@ desc "Run all linters" task lint: :environment do - if Rails.env.development? - sh "bundle exec erblint --lint-all --autocorrect" - else - sh "bundle exec erblint --lint-all" - end + sh "bundle exec erblint --lint-all" sh "bundle exec rubocop" sh "yarn run lint" end