From bcf7ceede39516c22b9916e55f6df51da2566554 Mon Sep 17 00:00:00 2001 From: Kate Higa <16447748+khiga8@users.noreply.github.com> Date: Tue, 13 Jun 2023 20:35:46 -0400 Subject: [PATCH 01/45] Add test to ensure recommended setup works --- .erb-lint.yml | 4 ++++ .erb-linters/linters.rb | 1 + test/linter_test_case.rb | 4 +--- test/recommended_setup_works_test.rb | 22 ++++++++++++++++++++++ 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 .erb-lint.yml create mode 100644 .erb-linters/linters.rb create mode 100644 test/recommended_setup_works_test.rb diff --git a/.erb-lint.yml b/.erb-lint.yml new file mode 100644 index 0000000..be2bc7e --- /dev/null +++ b/.erb-lint.yml @@ -0,0 +1,4 @@ +--- +inherit_gem: + erblint-github: + - config/accessibility.yml diff --git a/.erb-linters/linters.rb b/.erb-linters/linters.rb new file mode 100644 index 0000000..c0e4b62 --- /dev/null +++ b/.erb-linters/linters.rb @@ -0,0 +1 @@ +require "erblint-github/linters" diff --git a/test/linter_test_case.rb b/test/linter_test_case.rb index b3351ec..322d395 100644 --- a/test/linter_test_case.rb +++ b/test/linter_test_case.rb @@ -5,9 +5,7 @@ def setup @linter = linter_class&.new(file_loader, linter_class.config_schema.new) end - def linter_class - raise NotImplementedError - end + def linter_class; end def offenses @linter.offenses diff --git a/test/recommended_setup_works_test.rb b/test/recommended_setup_works_test.rb new file mode 100644 index 0000000..8398c11 --- /dev/null +++ b/test/recommended_setup_works_test.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require "test_helper" + +class RecommendedSetupWorksTest < LinterTestCase + # The ability to share rules and configs from other gems in erb_lint is not well-documented. + # This test validates that our recommended setup works. + def test_asserts_recommended_setup_works + erb_lint_config = ERBLint::RunnerConfig.new(file_loader.yaml(".erb-lint.yml"), file_loader) + + rules_enabled_in_accessibility_config = 0 + erb_lint_config.to_hash["linters"].each do |linter| + if linter[0].include?("GitHub::Accessibility") && linter[1]["enabled"] == true + rules_enabled_in_accessibility_config += 1 + end + end + known_linter_names ||= ERBLint::LinterRegistry.linters.map(&:simple_name) + + assert_equal 15, rules_enabled_in_accessibility_config + assert_equal 15, known_linter_names.count { |linter| linter.include?("GitHub::Accessibility") } + end +end From a5fc949f7c950527265d9f83c2e37d4c7e63ad3e Mon Sep 17 00:00:00 2001 From: Kate Higa <16447748+khiga8@users.noreply.github.com> Date: Fri, 16 Jun 2023 14:27:02 -0400 Subject: [PATCH 02/45] Update accessibility.yml --- config/accessibility.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/accessibility.yml b/config/accessibility.yml index e55a2cb..752c5ba 100644 --- a/config/accessibility.yml +++ b/config/accessibility.yml @@ -1,5 +1,7 @@ --- linters: + NoUnusedDisable: + enabled: true GitHub::Accessibility::AriaLabelIsWellFormatted: enabled: true GitHub::Accessibility::AvoidBothDisabledAndAriaDisabled: From 069676a294ec4ca2a9a79c766ce552c617e0fa7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jun 2023 04:04:31 +0000 Subject: [PATCH 03/45] Update rubocop requirement from = 1.52.0 to = 1.52.1 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.52.0...v1.52.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 11 ++++++----- erblint-github.gemspec | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1d6d837..206f5db 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -50,8 +50,9 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) parallel (1.23.0) - parser (3.2.2.1) + parser (3.2.2.3) ast (~> 2.4.1) + racc racc (1.6.2) rack (3.0.4.1) rails-dom-testing (2.0.3) @@ -62,12 +63,12 @@ GEM nokogiri (~> 1.14) rainbow (3.1.1) rake (13.0.6) - regexp_parser (2.8.0) + regexp_parser (2.8.1) rexml (3.2.5) - rubocop (1.52.0) + rubocop (1.52.1) json (~> 2.3) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) @@ -103,7 +104,7 @@ DEPENDENCIES minitest (~> 5.18.0) mocha (~> 2.0.2) rake (~> 13.0.6) - rubocop (= 1.52.0) + rubocop (= 1.52.1) rubocop-github (~> 0.20.0) BUNDLED WITH diff --git a/erblint-github.gemspec b/erblint-github.gemspec index 7ee6e32..33db08b 100644 --- a/erblint-github.gemspec +++ b/erblint-github.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.add_development_dependency "mocha", "~> 2.0.2" s.add_development_dependency "rake", "~> 13.0.6" - s.add_development_dependency "rubocop", "= 1.52.0" + s.add_development_dependency "rubocop", "= 1.52.1" s.add_development_dependency "rubocop-github", "~> 0.20.0" s.metadata["rubygems_mfa_required"] = "true" end From 5d2baf9ad4adc33fb8d03603663a8d1662282df6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jun 2023 04:04:38 +0000 Subject: [PATCH 04/45] Bump minitest from 5.18.0 to 5.18.1 Bumps [minitest](https://github.com/minitest/minitest) from 5.18.0 to 5.18.1. - [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc) - [Commits](https://github.com/minitest/minitest/compare/v5.18.0...v5.18.1) --- updated-dependencies: - dependency-name: minitest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1d6d837..f24fd91 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -43,7 +43,7 @@ GEM crass (~> 1.0.2) nokogiri (>= 1.12.0) mini_portile2 (2.8.2) - minitest (5.18.0) + minitest (5.18.1) mocha (2.0.4) ruby2_keywords (>= 0.0.5) nokogiri (1.15.2) From 525453ea9836e6fc8793ce57506e46f1a772f05d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 04:04:52 +0000 Subject: [PATCH 05/45] Update rubocop requirement from = 1.52.1 to = 1.53.0 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.52.1...v1.53.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 8 +++++--- erblint-github.gemspec | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index bcd9a72..ffea261 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -39,6 +39,7 @@ GEM i18n (1.13.0) concurrent-ruby (~> 1.0) json (2.6.3) + language_server-protocol (3.17.0.3) loofah (2.21.3) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -53,7 +54,7 @@ GEM parser (3.2.2.3) ast (~> 2.4.1) racc - racc (1.6.2) + racc (1.7.1) rack (3.0.4.1) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) @@ -65,8 +66,9 @@ GEM rake (13.0.6) regexp_parser (2.8.1) rexml (3.2.5) - rubocop (1.52.1) + rubocop (1.53.0) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) @@ -104,7 +106,7 @@ DEPENDENCIES minitest (~> 5.18.0) mocha (~> 2.0.2) rake (~> 13.0.6) - rubocop (= 1.52.1) + rubocop (= 1.53.0) rubocop-github (~> 0.20.0) BUNDLED WITH diff --git a/erblint-github.gemspec b/erblint-github.gemspec index 33db08b..c4edc28 100644 --- a/erblint-github.gemspec +++ b/erblint-github.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.add_development_dependency "mocha", "~> 2.0.2" s.add_development_dependency "rake", "~> 13.0.6" - s.add_development_dependency "rubocop", "= 1.52.1" + s.add_development_dependency "rubocop", "= 1.53.0" s.add_development_dependency "rubocop-github", "~> 0.20.0" s.metadata["rubygems_mfa_required"] = "true" end From f4a2adc360ba71ea973cf7371f9766d245ad47de Mon Sep 17 00:00:00 2001 From: Lindsey Wild <35239154+lindseywild@users.noreply.github.com> Date: Tue, 27 Jun 2023 15:06:17 +0000 Subject: [PATCH 06/45] explicit return false --- lib/erblint-github/linters/custom_helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/erblint-github/linters/custom_helpers.rb b/lib/erblint-github/linters/custom_helpers.rb index ff953b5..d43eb4c 100644 --- a/lib/erblint-github/linters/custom_helpers.rb +++ b/lib/erblint-github/linters/custom_helpers.rb @@ -47,7 +47,7 @@ def counter_correct?(processed_source) if offenses_count.zero? # have to adjust to get `\n` so we delete the whole line add_offense(processed_source.to_source_range(comment_node.loc.adjust(end_pos: 1)), "Unused erblint:counter comment for #{rule_name}", "") if comment_node - return + return false end first_offense = @offenses[0] From 5cb8b942f692b1d7f15d2852d3fdd7bb5da58213 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jul 2023 03:44:43 +0000 Subject: [PATCH 07/45] Update rubocop requirement from = 1.53.0 to = 1.54.0 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.53.0...v1.54.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- erblint-github.gemspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ffea261..44e47d9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -66,7 +66,7 @@ GEM rake (13.0.6) regexp_parser (2.8.1) rexml (3.2.5) - rubocop (1.53.0) + rubocop (1.54.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -106,7 +106,7 @@ DEPENDENCIES minitest (~> 5.18.0) mocha (~> 2.0.2) rake (~> 13.0.6) - rubocop (= 1.53.0) + rubocop (= 1.54.0) rubocop-github (~> 0.20.0) BUNDLED WITH diff --git a/erblint-github.gemspec b/erblint-github.gemspec index c4edc28..6f8123b 100644 --- a/erblint-github.gemspec +++ b/erblint-github.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.add_development_dependency "mocha", "~> 2.0.2" s.add_development_dependency "rake", "~> 13.0.6" - s.add_development_dependency "rubocop", "= 1.53.0" + s.add_development_dependency "rubocop", "= 1.54.0" s.add_development_dependency "rubocop-github", "~> 0.20.0" s.metadata["rubygems_mfa_required"] = "true" end From 33894ebbcf1f4848e85515be5c3e410786f0743b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 03:36:59 +0000 Subject: [PATCH 08/45] Update rubocop requirement from = 1.54.0 to = 1.54.1 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.54.0...v1.54.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- erblint-github.gemspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 44e47d9..1cec70a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -66,7 +66,7 @@ GEM rake (13.0.6) regexp_parser (2.8.1) rexml (3.2.5) - rubocop (1.54.0) + rubocop (1.54.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -106,7 +106,7 @@ DEPENDENCIES minitest (~> 5.18.0) mocha (~> 2.0.2) rake (~> 13.0.6) - rubocop (= 1.54.0) + rubocop (= 1.54.1) rubocop-github (~> 0.20.0) BUNDLED WITH diff --git a/erblint-github.gemspec b/erblint-github.gemspec index 6f8123b..2791199 100644 --- a/erblint-github.gemspec +++ b/erblint-github.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.add_development_dependency "mocha", "~> 2.0.2" s.add_development_dependency "rake", "~> 13.0.6" - s.add_development_dependency "rubocop", "= 1.54.0" + s.add_development_dependency "rubocop", "= 1.54.1" s.add_development_dependency "rubocop-github", "~> 0.20.0" s.metadata["rubygems_mfa_required"] = "true" end From 48c526ef182024f353a9762968cfdd4fb5612bd6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 03:42:33 +0000 Subject: [PATCH 09/45] Bump github/accessibility-alt-text-bot from 1.2.0 to 1.3.0 Bumps [github/accessibility-alt-text-bot](https://github.com/github/accessibility-alt-text-bot) from 1.2.0 to 1.3.0. - [Release notes](https://github.com/github/accessibility-alt-text-bot/releases) - [Commits](https://github.com/github/accessibility-alt-text-bot/compare/v1.2.0...v1.3.0) --- updated-dependencies: - dependency-name: github/accessibility-alt-text-bot dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/accessibility-alt-text-bot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/accessibility-alt-text-bot.yml b/.github/workflows/accessibility-alt-text-bot.yml index 4b3c2b3..192edb8 100644 --- a/.github/workflows/accessibility-alt-text-bot.yml +++ b/.github/workflows/accessibility-alt-text-bot.yml @@ -23,4 +23,4 @@ jobs: if: ${{ github.event.issue || github.event.pull_request || github.event.discussion }} steps: - name: Get action 'github/accessibility-alt-text-bot' - uses: github/accessibility-alt-text-bot@v1.2.0 + uses: github/accessibility-alt-text-bot@v1.3.0 From 3f89e3cd77de3e4ea44543c1fa00804b5bbe0ad2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 03:14:58 +0000 Subject: [PATCH 10/45] Update rubocop requirement from = 1.54.1 to = 1.54.2 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.54.1...v1.54.2) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- erblint-github.gemspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1cec70a..1529014 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -66,7 +66,7 @@ GEM rake (13.0.6) regexp_parser (2.8.1) rexml (3.2.5) - rubocop (1.54.1) + rubocop (1.54.2) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -106,7 +106,7 @@ DEPENDENCIES minitest (~> 5.18.0) mocha (~> 2.0.2) rake (~> 13.0.6) - rubocop (= 1.54.1) + rubocop (= 1.54.2) rubocop-github (~> 0.20.0) BUNDLED WITH diff --git a/erblint-github.gemspec b/erblint-github.gemspec index 2791199..4f3f96f 100644 --- a/erblint-github.gemspec +++ b/erblint-github.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.add_development_dependency "mocha", "~> 2.0.2" s.add_development_dependency "rake", "~> 13.0.6" - s.add_development_dependency "rubocop", "= 1.54.1" + s.add_development_dependency "rubocop", "= 1.54.2" s.add_development_dependency "rubocop-github", "~> 0.20.0" s.metadata["rubygems_mfa_required"] = "true" end From ab3e1c96c311a7559aac1136b1c6e60b32c2d5c7 Mon Sep 17 00:00:00 2001 From: Kendall Gassner Date: Thu, 20 Jul 2023 21:55:48 +0000 Subject: [PATCH 11/45] wip --- config/accessibility.yml | 2 + ...no_visually_hidden_interactive_elements.rb | 33 +++++++++++++ ...sually_hidden_interactive_elements_test.rb | 49 +++++++++++++++++++ test/recommended_setup_works_test.rb | 4 +- 4 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 lib/erblint-github/linters/github/accessibility/no_visually_hidden_interactive_elements.rb create mode 100644 test/linters/accessibility/no_visually_hidden_interactive_elements_test.rb diff --git a/config/accessibility.yml b/config/accessibility.yml index 752c5ba..eeb9bc3 100644 --- a/config/accessibility.yml +++ b/config/accessibility.yml @@ -32,3 +32,5 @@ linters: enabled: true GitHub::Accessibility::SvgHasAccessibleText: enabled: true + GitHub::Accessibility::NoVisuallyHiddenInteractiveElements: + enabled: true diff --git a/lib/erblint-github/linters/github/accessibility/no_visually_hidden_interactive_elements.rb b/lib/erblint-github/linters/github/accessibility/no_visually_hidden_interactive_elements.rb new file mode 100644 index 0000000..3d7b4fe --- /dev/null +++ b/lib/erblint-github/linters/github/accessibility/no_visually_hidden_interactive_elements.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require_relative "../../custom_helpers" + +module ERBLint + module Linters + module GitHub + module Accessibility + class NoVisuallyHiddenInteractiveElements < Linter + include ERBLint::Linters::CustomHelpers + include LinterRegistry + INTERACTIVE_ELEMENTS = %w[a button summary select option textarea].freeze + + MESSAGE = "Avoid visually hidding interactive elements. Visually hiding interactive elements can be confusing to sighted keyboard users as it appears their focus has been lost when they navigate to the hidden element" + + def run(processed_source) + visually_hidden = false + + tags(processed_source).each do |tag| + next if tag.closing? + classes = possible_attribute_values(tag, "class") + visually_hidden = true if classes.include?("sr-only") + next unless classes.include?("sr-only") || visually_hidden + if INTERACTIVE_ELEMENTS.include?(tag.name) + generate_offense(self.class, processed_source, tag) + end + end + end + end + end + end + end +end diff --git a/test/linters/accessibility/no_visually_hidden_interactive_elements_test.rb b/test/linters/accessibility/no_visually_hidden_interactive_elements_test.rb new file mode 100644 index 0000000..0a5e7e0 --- /dev/null +++ b/test/linters/accessibility/no_visually_hidden_interactive_elements_test.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +require "test_helper" + +class NoVisuallyHiddenInteractiveElements < LinterTestCase + def linter_class + ERBLint::Linters::GitHub::Accessibility::NoVisuallyHiddenInteractiveElements + end + + def test_warns_if_element_is_interactive_and_visually_hidden + @file = "" + @linter.run(processed_source) + + assert_equal(1, @linter.offenses.count) + error_messages = @linter.offenses.map(&:message).sort + assert_match(/Avoid visually hidding interactive elements. Visually hiding interactive elements can be confusing to sighted keyboard users as it appears their focus has been lost when they navigate to the hidden element/, error_messages.last) + end + + def test_does_not_warn_if_element_is_not_interactive_and_visually_hidden + @file = "
Text
" + @linter.run(processed_source) + + assert_empty @linter.offenses + end + + + def test_does_not_warn_if_element_is_interactive_and_not_visually_hidden + @file = "" + @linter.run(processed_source) + + assert_empty @linter.offenses + end + + def test_does_not_warn_if_element_is_interactive_and_shown_on_focus + @file = "skip to main content" + @linter.run(processed_source) + + assert_empty @linter.offenses + end + + def test_warn_if_element_is_interactive_in_a_visually_hidden_parent + @file = "
" + @linter.run(processed_source) + + assert_equal(1, @linter.offenses.count) + error_messages = @linter.offenses.map(&:message).sort + assert_match(/Avoid visually hidding interactive elements. Visually hiding interactive elements can be confusing to sighted keyboard users as it appears their focus has been lost when they navigate to the hidden element/, error_messages.last) + end +end diff --git a/test/recommended_setup_works_test.rb b/test/recommended_setup_works_test.rb index 8398c11..ad29525 100644 --- a/test/recommended_setup_works_test.rb +++ b/test/recommended_setup_works_test.rb @@ -16,7 +16,7 @@ def test_asserts_recommended_setup_works end known_linter_names ||= ERBLint::LinterRegistry.linters.map(&:simple_name) - assert_equal 15, rules_enabled_in_accessibility_config - assert_equal 15, known_linter_names.count { |linter| linter.include?("GitHub::Accessibility") } + assert_equal 16, rules_enabled_in_accessibility_config + assert_equal 16, known_linter_names.count { |linter| linter.include?("GitHub::Accessibility") } end end From 33aed063c1294ca6c8e7d0bb9c300a6a56d9a2d6 Mon Sep 17 00:00:00 2001 From: Kendall Gassner Date: Fri, 21 Jul 2023 18:02:18 +0000 Subject: [PATCH 12/45] add docs --- ...no-visually-hidden-interactive-elements.md | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 docs/rules/accessibility/no-visually-hidden-interactive-elements.md diff --git a/docs/rules/accessibility/no-visually-hidden-interactive-elements.md b/docs/rules/accessibility/no-visually-hidden-interactive-elements.md new file mode 100644 index 0000000..29e4a7c --- /dev/null +++ b/docs/rules/accessibility/no-visually-hidden-interactive-elements.md @@ -0,0 +1,36 @@ +# No visually hidden interactive elements + +## Rule Details + +This rule guards against visually hiding interactive elements. If a sighted keyboard user navigates to an interactive element that is visually hidden they might become confused and assume that keyboard focus has been lost. + +Note: we are not guarding against visually hidden `input` elements at this time. Some visually hidden inputs might cause a false positive (e.g. some file inputs). + +### Why do we visually hide content? + +Visually hiding content can be useful when you want to provide information specifically to screen reader users or other assistive technology users while keeping content hidden from sighted users. + +Applying the following css will visually hide content while still making it accessible to screen reader users. + +```css +clip-path: inset(50%); +height: 1px; +overflow: hidden; +position: absolute; +white-space: nowrap; +width: 1px; +``` + +👎 Examples of **incorrect** code for this rule: + +```jsx +

Welcome to GitHub

+``` + +👍 Examples of **correct** code for this rule: + +```jsx +

Welcome to GitHub

+``` + +## Version From 5dcd3d002df5fe03f1d8afd356cf7244e29d28a5 Mon Sep 17 00:00:00 2001 From: Kendall Gassner Date: Fri, 21 Jul 2023 11:40:02 -0700 Subject: [PATCH 13/45] Update docs/rules/accessibility/no-visually-hidden-interactive-elements.md --- .../accessibility/no-visually-hidden-interactive-elements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rules/accessibility/no-visually-hidden-interactive-elements.md b/docs/rules/accessibility/no-visually-hidden-interactive-elements.md index 29e4a7c..32cbea4 100644 --- a/docs/rules/accessibility/no-visually-hidden-interactive-elements.md +++ b/docs/rules/accessibility/no-visually-hidden-interactive-elements.md @@ -24,7 +24,7 @@ width: 1px; 👎 Examples of **incorrect** code for this rule: ```jsx -

Welcome to GitHub

+ ``` 👍 Examples of **correct** code for this rule: From 5eedaa263eb80385808a3b28f141819d7a6e0136 Mon Sep 17 00:00:00 2001 From: Kendall Gassner Date: Fri, 21 Jul 2023 18:43:51 +0000 Subject: [PATCH 14/45] lint --- .../no_visually_hidden_interactive_elements.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/erblint-github/linters/github/accessibility/no_visually_hidden_interactive_elements.rb b/lib/erblint-github/linters/github/accessibility/no_visually_hidden_interactive_elements.rb index 3d7b4fe..d431763 100644 --- a/lib/erblint-github/linters/github/accessibility/no_visually_hidden_interactive_elements.rb +++ b/lib/erblint-github/linters/github/accessibility/no_visually_hidden_interactive_elements.rb @@ -21,9 +21,9 @@ def run(processed_source) classes = possible_attribute_values(tag, "class") visually_hidden = true if classes.include?("sr-only") next unless classes.include?("sr-only") || visually_hidden - if INTERACTIVE_ELEMENTS.include?(tag.name) - generate_offense(self.class, processed_source, tag) - end + if INTERACTIVE_ELEMENTS.include?(tag.name) + generate_offense(self.class, processed_source, tag) + end end end end From 18a93922c983f6c569770686c4430544ccae93aa Mon Sep 17 00:00:00 2001 From: Jeremy Neal Date: Thu, 27 Jul 2023 14:59:14 -0400 Subject: [PATCH 15/45] Copied erblint-disable script from dotcom to this gem, exposed via spec.executables. --- bin/erblint-disable | 53 ++++++++++++++++++++++++++++++++++++++++++ erblint-github.gemspec | 2 ++ 2 files changed, 55 insertions(+) create mode 100644 bin/erblint-disable diff --git a/bin/erblint-disable b/bin/erblint-disable new file mode 100644 index 0000000..8d7b95a --- /dev/null +++ b/bin/erblint-disable @@ -0,0 +1,53 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require "json" + +# Accepts comma-separated args with simple rule name +# e.g. script/erblint-disable SomeRule1,SomeRule2 +# e.g. script/erblint-disable GitHub::Accessibility::Rule1,SomeRule2 +rules = ARGV[0] + +rules_array = rules.split(",") +rules_map = {} +rules_array.each do |rule| + rule_underscored = rule.to_s.gsub(/::/, "/"). + gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2'). + gsub(/([a-z\d])([A-Z])/, '\1_\2'). + tr("-", "_"). + downcase. + gsub("git_hub", "github") # corrects rule names with `GitHub` name to align with erb-lint expectations + rules_map[rule] = rule_underscored +end + +rules_map.each do |disable_comment_name, command_line_name| + output = `bin/erblint --format json --enable-linters #{command_line_name} app/views app/components packages/**/app/components app/forms/**/` + hashed_output = JSON.parse(output) + hashed_output["files"].each do |file| + path = file["path"] + offenses = file["offenses"] + line_numbers = offenses.map do |offense| + offense["location"]["last_line"] + end + File.open(path, "r+") do |file| + lines = file.each_line.to_a + line_numbers.each do |line_number| + line = lines[line_number - 1] + unless line.match?(/erblint:disable (?.*#{disable_comment_name}).*/) + existing_disable = line.match(/(?<=# erblint:disable)(.*) (?=%>)/) + if existing_disable + existing_disable_string = existing_disable.captures[0] + add_new_disable = "#{existing_disable_string}, #{disable_comment_name}" + lines[line_number - 1] = lines[line_number - 1].gsub(existing_disable_string, add_new_disable) + else + lines[line_number - 1] = lines[line_number - 1].gsub("\n", "") + "<%# erblint:disable #{disable_comment_name} %>\n" + end + end + end + file.rewind + file.write(lines.join) + end + end +end + +exit 0 diff --git a/erblint-github.gemspec b/erblint-github.gemspec index 4f3f96f..09787ba 100644 --- a/erblint-github.gemspec +++ b/erblint-github.gemspec @@ -24,4 +24,6 @@ Gem::Specification.new do |s| s.add_development_dependency "rubocop", "= 1.54.2" s.add_development_dependency "rubocop-github", "~> 0.20.0" s.metadata["rubygems_mfa_required"] = "true" + + s.executables << "erblint-disable" end From 6c064e5772c0deb20b4978b8b0ecd8d4c3571b01 Mon Sep 17 00:00:00 2001 From: Jeremy Neal Date: Thu, 27 Jul 2023 15:05:49 -0400 Subject: [PATCH 16/45] Linting. --- bin/erblint-disable | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 bin/erblint-disable diff --git a/bin/erblint-disable b/bin/erblint-disable old mode 100644 new mode 100755 index 8d7b95a..d8ecf75 --- a/bin/erblint-disable +++ b/bin/erblint-disable @@ -11,7 +11,7 @@ rules = ARGV[0] rules_array = rules.split(",") rules_map = {} rules_array.each do |rule| - rule_underscored = rule.to_s.gsub(/::/, "/"). + rule_underscored = rule.to_s.gsub("::", "/"). gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2'). gsub(/([a-z\d])([A-Z])/, '\1_\2'). tr("-", "_"). From f9426d2b1f386869fa4a8f3293fe0eb91af16167 Mon Sep 17 00:00:00 2001 From: Jeremy Neal Date: Thu, 27 Jul 2023 15:12:06 -0400 Subject: [PATCH 17/45] Bump version in gemspec in preparation for next release. --- erblint-github.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erblint-github.gemspec b/erblint-github.gemspec index 09787ba..c327a46 100644 --- a/erblint-github.gemspec +++ b/erblint-github.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = "erblint-github" - s.version = "0.4.1" + s.version = "0.4.2" s.summary = "erblint GitHub" s.description = "Template style checking for GitHub Ruby repositories" s.homepage = "https://github.com/github/erblint-github" From cdec6617703b1c98659153d21068ee0e7f69d550 Mon Sep 17 00:00:00 2001 From: Jeremy Neal Date: Thu, 27 Jul 2023 15:35:08 -0400 Subject: [PATCH 18/45] Change version back, all actions are failing. --- Gemfile.lock | 2 +- erblint-github.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1529014..535b8fc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - erblint-github (0.4.1) + erblint-github (0.4.2) GEM remote: https://rubygems.org/ diff --git a/erblint-github.gemspec b/erblint-github.gemspec index c327a46..09787ba 100644 --- a/erblint-github.gemspec +++ b/erblint-github.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = "erblint-github" - s.version = "0.4.2" + s.version = "0.4.1" s.summary = "erblint GitHub" s.description = "Template style checking for GitHub Ruby repositories" s.homepage = "https://github.com/github/erblint-github" From d9bd96b7b4669dc37b847fe222af7fe72cd92024 Mon Sep 17 00:00:00 2001 From: Jeremy Neal Date: Thu, 27 Jul 2023 15:37:09 -0400 Subject: [PATCH 19/45] Fix Gemfile as well. --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 535b8fc..1529014 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - erblint-github (0.4.2) + erblint-github (0.4.1) GEM remote: https://rubygems.org/ From 3eebfd870ac353bd3fdaa486524877f627bf99a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Jul 2023 03:12:58 +0000 Subject: [PATCH 20/45] Update rubocop requirement from = 1.54.2 to = 1.55.0 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.54.2...v1.55.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 8 ++++---- erblint-github.gemspec | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1529014..72d8a18 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -65,8 +65,8 @@ GEM rainbow (3.1.1) rake (13.0.6) regexp_parser (2.8.1) - rexml (3.2.5) - rubocop (1.54.2) + rexml (3.2.6) + rubocop (1.55.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -74,7 +74,7 @@ GEM rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.29.0) @@ -106,7 +106,7 @@ DEPENDENCIES minitest (~> 5.18.0) mocha (~> 2.0.2) rake (~> 13.0.6) - rubocop (= 1.54.2) + rubocop (= 1.55.0) rubocop-github (~> 0.20.0) BUNDLED WITH diff --git a/erblint-github.gemspec b/erblint-github.gemspec index 4f3f96f..9de6e1e 100644 --- a/erblint-github.gemspec +++ b/erblint-github.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.add_development_dependency "mocha", "~> 2.0.2" s.add_development_dependency "rake", "~> 13.0.6" - s.add_development_dependency "rubocop", "= 1.54.2" + s.add_development_dependency "rubocop", "= 1.55.0" s.add_development_dependency "rubocop-github", "~> 0.20.0" s.metadata["rubygems_mfa_required"] = "true" end From d615ddefc3da8b5be8c1db03fb87a655b6f761b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Jul 2023 21:12:25 +0000 Subject: [PATCH 21/45] Update mocha requirement from ~> 2.0.2 to ~> 2.1.0 Updates the requirements on [mocha](https://github.com/freerange/mocha) to permit the latest version. - [Changelog](https://github.com/freerange/mocha/blob/main/RELEASE.md) - [Commits](https://github.com/freerange/mocha/compare/v2.0.4...v2.1.0) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- erblint-github.gemspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 72d8a18..816862e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,7 +45,7 @@ GEM nokogiri (>= 1.12.0) mini_portile2 (2.8.2) minitest (5.18.1) - mocha (2.0.4) + mocha (2.1.0) ruby2_keywords (>= 0.0.5) nokogiri (1.15.2) mini_portile2 (~> 2.8.2) @@ -104,7 +104,7 @@ DEPENDENCIES erb_lint (~> 0.4.0) erblint-github! minitest (~> 5.18.0) - mocha (~> 2.0.2) + mocha (~> 2.1.0) rake (~> 13.0.6) rubocop (= 1.55.0) rubocop-github (~> 0.20.0) diff --git a/erblint-github.gemspec b/erblint-github.gemspec index 9de6e1e..86b3870 100644 --- a/erblint-github.gemspec +++ b/erblint-github.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |s| s.add_development_dependency "erb_lint", "~> 0.4.0" s.add_development_dependency "minitest", "~> 5.18.0" - s.add_development_dependency "mocha", "~> 2.0.2" + s.add_development_dependency "mocha", "~> 2.1.0" s.add_development_dependency "rake", "~> 13.0.6" s.add_development_dependency "rubocop", "= 1.55.0" From 92079327dd9bc57a0c2d131ccfda10f6a790541e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Jul 2023 21:34:45 +0000 Subject: [PATCH 22/45] Update minitest requirement from ~> 5.18.0 to ~> 5.19.0 Updates the requirements on [minitest](https://github.com/minitest/minitest) to permit the latest version. - [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc) - [Commits](https://github.com/minitest/minitest/compare/v5.18.1...v5.19.0) --- updated-dependencies: - dependency-name: minitest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- erblint-github.gemspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 816862e..ee38210 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -44,7 +44,7 @@ GEM crass (~> 1.0.2) nokogiri (>= 1.12.0) mini_portile2 (2.8.2) - minitest (5.18.1) + minitest (5.19.0) mocha (2.1.0) ruby2_keywords (>= 0.0.5) nokogiri (1.15.2) @@ -103,7 +103,7 @@ PLATFORMS DEPENDENCIES erb_lint (~> 0.4.0) erblint-github! - minitest (~> 5.18.0) + minitest (~> 5.19.0) mocha (~> 2.1.0) rake (~> 13.0.6) rubocop (= 1.55.0) diff --git a/erblint-github.gemspec b/erblint-github.gemspec index 86b3870..75dae0f 100644 --- a/erblint-github.gemspec +++ b/erblint-github.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |s| s.authors = ["GitHub Open Source"] s.add_development_dependency "erb_lint", "~> 0.4.0" - s.add_development_dependency "minitest", "~> 5.18.0" + s.add_development_dependency "minitest", "~> 5.19.0" s.add_development_dependency "mocha", "~> 2.1.0" s.add_development_dependency "rake", "~> 13.0.6" From 3fa61dd8241a41dd77ad2a2585b65d1fae8c0789 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Aug 2023 03:38:22 +0000 Subject: [PATCH 23/45] Update rubocop requirement from = 1.55.0 to = 1.55.1 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.55.0...v1.55.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- erblint-github.gemspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ee38210..01ac921 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -66,7 +66,7 @@ GEM rake (13.0.6) regexp_parser (2.8.1) rexml (3.2.6) - rubocop (1.55.0) + rubocop (1.55.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -106,7 +106,7 @@ DEPENDENCIES minitest (~> 5.19.0) mocha (~> 2.1.0) rake (~> 13.0.6) - rubocop (= 1.55.0) + rubocop (= 1.55.1) rubocop-github (~> 0.20.0) BUNDLED WITH diff --git a/erblint-github.gemspec b/erblint-github.gemspec index 75dae0f..e84f420 100644 --- a/erblint-github.gemspec +++ b/erblint-github.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.add_development_dependency "mocha", "~> 2.1.0" s.add_development_dependency "rake", "~> 13.0.6" - s.add_development_dependency "rubocop", "= 1.55.0" + s.add_development_dependency "rubocop", "= 1.55.1" s.add_development_dependency "rubocop-github", "~> 0.20.0" s.metadata["rubygems_mfa_required"] = "true" end From b2432215f7863510a6653e2be15f6354c8a8c2ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Aug 2023 03:30:45 +0000 Subject: [PATCH 24/45] Update rubocop requirement from = 1.55.1 to = 1.56.0 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.55.1...v1.56.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 ++++-- erblint-github.gemspec | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 01ac921..ce4a63b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,6 +18,7 @@ GEM minitest (>= 5.1) tzinfo (~> 2.0) ast (2.4.2) + base64 (0.1.1) better_html (2.0.1) actionview (>= 6.0) activesupport (>= 6.0) @@ -66,7 +67,8 @@ GEM rake (13.0.6) regexp_parser (2.8.1) rexml (3.2.6) - rubocop (1.55.1) + rubocop (1.56.0) + base64 (~> 0.1.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -106,7 +108,7 @@ DEPENDENCIES minitest (~> 5.19.0) mocha (~> 2.1.0) rake (~> 13.0.6) - rubocop (= 1.55.1) + rubocop (= 1.56.0) rubocop-github (~> 0.20.0) BUNDLED WITH diff --git a/erblint-github.gemspec b/erblint-github.gemspec index b453169..a52df52 100644 --- a/erblint-github.gemspec +++ b/erblint-github.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.add_development_dependency "mocha", "~> 2.1.0" s.add_development_dependency "rake", "~> 13.0.6" - s.add_development_dependency "rubocop", "= 1.55.1" + s.add_development_dependency "rubocop", "= 1.56.0" s.add_development_dependency "rubocop-github", "~> 0.20.0" s.metadata["rubygems_mfa_required"] = "true" From a1bca0c08631454a0525b7edc08361d551eb7660 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Aug 2023 13:29:31 +0000 Subject: [PATCH 25/45] Bump activesupport from 7.0.5 to 7.0.7.2 Bumps [activesupport](https://github.com/rails/rails) from 7.0.5 to 7.0.7.2. - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v7.0.7.2/activesupport/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v7.0.5...v7.0.7.2) --- updated-dependencies: - dependency-name: activesupport dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ce4a63b..04b83e4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,20 +6,20 @@ PATH GEM remote: https://rubygems.org/ specs: - actionview (7.0.5) - activesupport (= 7.0.5) + actionview (7.0.7.2) + activesupport (= 7.0.7.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activesupport (7.0.5) + activesupport (7.0.7.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) ast (2.4.2) base64 (0.1.1) - better_html (2.0.1) + better_html (2.0.2) actionview (>= 6.0) activesupport (>= 6.0) ast (~> 2.0) @@ -37,7 +37,7 @@ GEM rubocop smart_properties erubi (1.12.0) - i18n (1.13.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) json (2.6.3) language_server-protocol (3.17.0.3) From 5b3b52abc1652108521541a8049137018ecfd65e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Aug 2023 13:29:36 +0000 Subject: [PATCH 26/45] Bump rack from 3.0.4.1 to 3.0.8 Bumps [rack](https://github.com/rack/rack) from 3.0.4.1 to 3.0.8. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/v3.0.4.1...v3.0.8) --- updated-dependencies: - dependency-name: rack dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ce4a63b..27aa883 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -56,7 +56,7 @@ GEM ast (~> 2.4.1) racc racc (1.7.1) - rack (3.0.4.1) + rack (3.0.8) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) From daf1bdb5ab5cce99fd0dbbee27b628f74bbea0bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 03:52:15 +0000 Subject: [PATCH 27/45] Update erb_lint requirement from ~> 0.4.0 to ~> 0.5.0 Updates the requirements on [erb_lint](https://github.com/Shopify/erb-lint) to permit the latest version. - [Release notes](https://github.com/Shopify/erb-lint/releases) - [Commits](https://github.com/Shopify/erb-lint/compare/v0.4.0...v0.5.0) --- updated-dependencies: - dependency-name: erb_lint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 13 +++++++------ erblint-github.gemspec | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3741d6f..82a9bb3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -29,7 +29,7 @@ GEM builder (3.2.4) concurrent-ruby (1.2.2) crass (1.0.6) - erb_lint (0.4.0) + erb_lint (0.5.0) activesupport better_html (>= 2.0.1) parser (>= 2.7.1.4) @@ -44,11 +44,11 @@ GEM loofah (2.21.3) crass (~> 1.0.2) nokogiri (>= 1.12.0) - mini_portile2 (2.8.2) + mini_portile2 (2.8.4) minitest (5.19.0) mocha (2.1.0) ruby2_keywords (>= 0.0.5) - nokogiri (1.15.2) + nokogiri (1.15.4) mini_portile2 (~> 2.8.2) racc (~> 1.4) parallel (1.23.0) @@ -57,8 +57,9 @@ GEM racc racc (1.7.1) rack (3.0.8) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) rails-html-sanitizer (1.6.0) loofah (~> 2.21) @@ -103,7 +104,7 @@ PLATFORMS ruby DEPENDENCIES - erb_lint (~> 0.4.0) + erb_lint (~> 0.5.0) erblint-github! minitest (~> 5.19.0) mocha (~> 2.1.0) diff --git a/erblint-github.gemspec b/erblint-github.gemspec index a52df52..c019ba2 100644 --- a/erblint-github.gemspec +++ b/erblint-github.gemspec @@ -16,7 +16,7 @@ Gem::Specification.new do |s| s.email = ["opensource+erblint-github@github.com"] s.authors = ["GitHub Open Source"] - s.add_development_dependency "erb_lint", "~> 0.4.0" + s.add_development_dependency "erb_lint", "~> 0.5.0" s.add_development_dependency "minitest", "~> 5.19.0" s.add_development_dependency "mocha", "~> 2.1.0" s.add_development_dependency "rake", "~> 13.0.6" From e50a312f3e633bcd3f57a2d153ea92132f27f455 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 03:52:24 +0000 Subject: [PATCH 28/45] Update rubocop requirement from = 1.56.0 to = 1.56.1 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.56.0...v1.56.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- erblint-github.gemspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3741d6f..f952f57 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -67,7 +67,7 @@ GEM rake (13.0.6) regexp_parser (2.8.1) rexml (3.2.6) - rubocop (1.56.0) + rubocop (1.56.1) base64 (~> 0.1.1) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -108,7 +108,7 @@ DEPENDENCIES minitest (~> 5.19.0) mocha (~> 2.1.0) rake (~> 13.0.6) - rubocop (= 1.56.0) + rubocop (= 1.56.1) rubocop-github (~> 0.20.0) BUNDLED WITH diff --git a/erblint-github.gemspec b/erblint-github.gemspec index a52df52..d44deda 100644 --- a/erblint-github.gemspec +++ b/erblint-github.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.add_development_dependency "mocha", "~> 2.1.0" s.add_development_dependency "rake", "~> 13.0.6" - s.add_development_dependency "rubocop", "= 1.56.0" + s.add_development_dependency "rubocop", "= 1.56.1" s.add_development_dependency "rubocop-github", "~> 0.20.0" s.metadata["rubygems_mfa_required"] = "true" From 6375b911a2b9d34cf1cbf920e5aeeac4fbf52279 Mon Sep 17 00:00:00 2001 From: Kate Higa <16447748+khiga8@users.noreply.github.com> Date: Tue, 29 Aug 2023 10:48:02 -0400 Subject: [PATCH 29/45] Update navigation-has-label.md --- .../accessibility/navigation-has-label.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/rules/accessibility/navigation-has-label.md b/docs/rules/accessibility/navigation-has-label.md index a664b10..4cd45d3 100644 --- a/docs/rules/accessibility/navigation-has-label.md +++ b/docs/rules/accessibility/navigation-has-label.md @@ -2,9 +2,11 @@ ## Rule Details -This rule enforces that a navigation landmark (a `