From 6b5c949f13a7fa1bc57797f782835f757fbdb6e7 Mon Sep 17 00:00:00 2001 From: Christina Chortaria Date: Tue, 5 Sep 2023 16:55:22 -0400 Subject: [PATCH] Add erb-lint with github accessibility rules Removed title from a tag to satisfy: The title attribute should never be used for an a tag Co-authored-by: Jane Sandberg Co-authored-by: Liz Garcia --- .erb-lint.yml | 5 +++++ .erb-linters/erblint-github.rb | 1 + Gemfile | 2 ++ Gemfile.lock | 18 ++++++++++++++++++ app/views/shared/_header_navbar.html.erb | 2 +- 5 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .erb-lint.yml create mode 100644 .erb-linters/erblint-github.rb diff --git a/.erb-lint.yml b/.erb-lint.yml new file mode 100644 index 000000000..03c1de5b0 --- /dev/null +++ b/.erb-lint.yml @@ -0,0 +1,5 @@ +--- +EnableDefaultLinters: false +inherit_gem: + erblint-github: + - config/accessibility.yml \ No newline at end of file diff --git a/.erb-linters/erblint-github.rb b/.erb-linters/erblint-github.rb new file mode 100644 index 000000000..c0e4b6277 --- /dev/null +++ b/.erb-linters/erblint-github.rb @@ -0,0 +1 @@ +require "erblint-github/linters" diff --git a/Gemfile b/Gemfile index 3b6ec5d8c..9583679de 100644 --- a/Gemfile +++ b/Gemfile @@ -118,6 +118,8 @@ group :development, :test do gem 'bixby', '~> 5.0' gem 'capybara' gem 'coveralls_reborn' + gem "erb_lint", require: false + gem "erblint-github" gem 'pry-byebug' gem 'solargraph' end diff --git a/Gemfile.lock b/Gemfile.lock index 309657330..e2a3adb46 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -108,6 +108,13 @@ GEM bcrypt (3.1.18) bcrypt_pbkdf (1.1.0) benchmark (0.2.1) + better_html (2.0.2) + actionview (>= 6.0) + activesupport (>= 6.0) + ast (~> 2.0) + erubi (~> 1.4) + parser (>= 2.4) + smart_properties bixby (5.0.2) rubocop (= 1.28.2) rubocop-ast @@ -226,6 +233,14 @@ GEM ed25519 (1.3.0) email_validator (2.2.4) activemodel + erb_lint (0.5.0) + activesupport + better_html (>= 2.0.1) + parser (>= 2.7.1.4) + rainbow + rubocop + smart_properties + erblint-github (0.4.1) erubi (1.12.0) execjs (2.8.1) ezwadl (0.1.0) @@ -523,6 +538,7 @@ GEM simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) slop (4.10.1) + smart_properties (1.17.0) sneakers (2.11.0) bunny (~> 2.12) concurrent-ruby (~> 1.0) @@ -667,6 +683,8 @@ DEPENDENCIES devise-guests (~> 0.5) ed25519 email_validator + erb_lint + erblint-github factory_bot_rails faker faraday (~> 0.17) diff --git a/app/views/shared/_header_navbar.html.erb b/app/views/shared/_header_navbar.html.erb index ebd9c3828..aa3dd5799 100644 --- a/app/views/shared/_header_navbar.html.erb +++ b/app/views/shared/_header_navbar.html.erb @@ -4,7 +4,7 @@
- + <%= image_tag("pul-logo-new.svg", alt: "Link to Princeton University Library home page") %> <%=link_to t('blacklight.orangelight').html_safe, main_app.root_path, :class => "site-title" %>