From 0f435eedd95ea24127d25318b4f3d120e38ff8b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Dias?= <39736248+andrefcdias@users.noreply.github.com> Date: Mon, 24 Apr 2023 23:14:09 +0200 Subject: [PATCH 01/19] Update aria-label-is-well-formatted.md --- docs/rules/accessibility/aria-label-is-well-formatted.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rules/accessibility/aria-label-is-well-formatted.md b/docs/rules/accessibility/aria-label-is-well-formatted.md index 90b4a67..ab19176 100644 --- a/docs/rules/accessibility/aria-label-is-well-formatted.md +++ b/docs/rules/accessibility/aria-label-is-well-formatted.md @@ -62,5 +62,5 @@ If you determine that there are valid scenarios for `aria-label` to start with l ```` ```erb - aria-label="Shopify/erb-lint on GitHub"> + ``` From a93b60042967700af621f0677fd6deea43246443 Mon Sep 17 00:00:00 2001 From: Andre Dias <39736248+andrefcdias@users.noreply.github.com> Date: Mon, 24 Apr 2023 23:20:21 +0200 Subject: [PATCH 02/19] fix other typo --- docs/rules/accessibility/aria-label-is-well-formatted.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rules/accessibility/aria-label-is-well-formatted.md b/docs/rules/accessibility/aria-label-is-well-formatted.md index ab19176..ff310d5 100644 --- a/docs/rules/accessibility/aria-label-is-well-formatted.md +++ b/docs/rules/accessibility/aria-label-is-well-formatted.md @@ -48,7 +48,7 @@ If you determine that there are valid scenarios for `aria-label` to start with l ``` ```erb - aria-label="github.com/shopify/erb-lint"> + ``` ### **Correct** code for this rule 👍 From 020dc7ca223a1a6e87bd67fd4e3a813a74928763 Mon Sep 17 00:00:00 2001 From: Kate Higa <16447748+khiga8@users.noreply.github.com> Date: Wed, 10 May 2023 10:40:13 -0400 Subject: [PATCH 03/19] Create accessibility-alt-text-bot.yml --- .../workflows/accessibility-alt-text-bot.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/accessibility-alt-text-bot.yml diff --git a/.github/workflows/accessibility-alt-text-bot.yml b/.github/workflows/accessibility-alt-text-bot.yml new file mode 100644 index 0000000..2f8aa75 --- /dev/null +++ b/.github/workflows/accessibility-alt-text-bot.yml @@ -0,0 +1,17 @@ +name: Accessibility-alt-text-bot +on: + issues: + types: [opened, edited] + pull_request: + types: [opened, edited] + issue_comment: + types: [created, edited] + +jobs: + accessibility_alt_text_bot: + name: Check alt text is set on issue or pull requests + runs-on: ubuntu-latest + if: ${{ github.event.issue || github.event.pull_request }} + steps: + - name: Get action 'github/accessibility-alt-text-bot' + uses: github/accessibility-alt-text-bot@v1.0.0 From 3d9f43f4af5cd3733e7783b905d635bc65338b97 Mon Sep 17 00:00:00 2001 From: Kate Higa <16447748+khiga8@users.noreply.github.com> Date: Wed, 31 May 2023 16:58:07 -0400 Subject: [PATCH 04/19] Update accessibility-alt-text-bot.yml --- .github/workflows/accessibility-alt-text-bot.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/accessibility-alt-text-bot.yml b/.github/workflows/accessibility-alt-text-bot.yml index 2f8aa75..3c09dbc 100644 --- a/.github/workflows/accessibility-alt-text-bot.yml +++ b/.github/workflows/accessibility-alt-text-bot.yml @@ -6,12 +6,16 @@ on: types: [opened, edited] issue_comment: types: [created, edited] + discussion: + types: [created, edited] + discussion_comment: + types: [created, edited] jobs: accessibility_alt_text_bot: name: Check alt text is set on issue or pull requests runs-on: ubuntu-latest - if: ${{ github.event.issue || github.event.pull_request }} + 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.0.0 + uses: github/accessibility-alt-text-bot@v1.2.0 From ce5c63c91bd4eab3f7e52e566161ff23afe33029 Mon Sep 17 00:00:00 2001 From: Kate Higa <16447748+khiga8@users.noreply.github.com> Date: Wed, 31 May 2023 16:59:28 -0400 Subject: [PATCH 05/19] Update accessibility-alt-text-bot.yml --- .github/workflows/accessibility-alt-text-bot.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/accessibility-alt-text-bot.yml b/.github/workflows/accessibility-alt-text-bot.yml index 3c09dbc..4b3c2b3 100644 --- a/.github/workflows/accessibility-alt-text-bot.yml +++ b/.github/workflows/accessibility-alt-text-bot.yml @@ -11,6 +11,11 @@ on: discussion_comment: types: [created, edited] +permissions: + issues: write + pull-requests: write + discussions: write + jobs: accessibility_alt_text_bot: name: Check alt text is set on issue or pull requests From 6a4f5779b5a080b731919b3afb82e499a2047cef Mon Sep 17 00:00:00 2001 From: Kate Higa <16447748+khiga8@users.noreply.github.com> Date: Thu, 1 Jun 2023 09:39:17 -0400 Subject: [PATCH 06/19] Add dependabot.yml --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..adf1f60 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: bundler + directory: "" + schedule: + interval: weekly + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly From 583e041927dfb9ee3fa2679ca2ccf812dcc1d63a Mon Sep 17 00:00:00 2001 From: Kate Higa <16447748+khiga8@users.noreply.github.com> Date: Thu, 1 Jun 2023 09:39:43 -0400 Subject: [PATCH 07/19] Update dependabot.yml --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index adf1f60..7b3eb46 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,7 @@ version: 2 updates: - package-ecosystem: bundler - directory: "" + directory: "/" schedule: interval: weekly - package-ecosystem: github-actions From e825299f81b0470759c41e0172ffe5ec1852c5c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Jun 2023 14:50:59 +0000 Subject: [PATCH 08/19] Update erb_lint requirement from ~> 0.3.0 to ~> 0.4.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.3.1...v0.4.0) --- updated-dependencies: - dependency-name: erb_lint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 39 ++++++++++++++++++++------------------- erblint-github.gemspec | 2 +- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2b54584..0d9f94e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,13 +6,13 @@ PATH GEM remote: https://rubygems.org/ specs: - actionview (7.0.4.2) - activesupport (= 7.0.4.2) + actionview (7.0.5) + activesupport (= 7.0.5) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activesupport (7.0.4.2) + activesupport (7.0.5) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -26,9 +26,9 @@ GEM parser (>= 2.4) smart_properties builder (3.2.4) - concurrent-ruby (1.2.0) + concurrent-ruby (1.2.2) crass (1.0.6) - erb_lint (0.3.1) + erb_lint (0.4.0) activesupport better_html (>= 2.0.1) parser (>= 2.7.1.4) @@ -36,32 +36,33 @@ GEM rubocop smart_properties erubi (1.12.0) - i18n (1.12.0) + i18n (1.13.0) concurrent-ruby (~> 1.0) json (2.6.3) - loofah (2.19.1) + loofah (2.21.3) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mini_portile2 (2.8.1) + nokogiri (>= 1.12.0) + mini_portile2 (2.8.2) minitest (5.18.0) mocha (2.0.2) ruby2_keywords (>= 0.0.5) - nokogiri (1.14.0) - mini_portile2 (~> 2.8.0) + nokogiri (1.15.2) + mini_portile2 (~> 2.8.2) racc (~> 1.4) - parallel (1.22.1) - parser (3.2.2.0) + parallel (1.23.0) + parser (3.2.2.1) ast (~> 2.4.1) racc (1.6.2) rack (3.0.4.1) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.5.0) - loofah (~> 2.19, >= 2.19.1) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) rainbow (3.1.1) rake (13.0.6) - regexp_parser (2.7.0) + regexp_parser (2.8.0) rexml (3.2.5) rubocop (1.49.0) json (~> 2.3) @@ -73,7 +74,7 @@ GEM rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.28.0) + rubocop-ast (1.29.0) parser (>= 3.2.1.0) rubocop-github (0.20.0) rubocop (>= 1.37) @@ -89,7 +90,7 @@ GEM ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) smart_properties (1.17.0) - tzinfo (2.0.5) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.4.2) @@ -97,7 +98,7 @@ PLATFORMS ruby DEPENDENCIES - erb_lint (~> 0.3.0) + erb_lint (~> 0.4.0) erblint-github! minitest (~> 5.18.0) mocha (~> 2.0.2) diff --git a/erblint-github.gemspec b/erblint-github.gemspec index 2aa3d55..8bf7cb3 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.3.0" + 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 "rake", "~> 13.0.6" From 47b03a17c2dd5a830dd9e4ac34d23e00aef82e74 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Jun 2023 16:22:14 +0000 Subject: [PATCH 09/19] Update rubocop requirement from = 1.49.0 to = 1.51.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.49.0...v1.51.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 0d9f94e..323cd5a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -64,7 +64,7 @@ GEM rake (13.0.6) regexp_parser (2.8.0) rexml (3.2.5) - rubocop (1.49.0) + rubocop (1.51.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) @@ -103,7 +103,7 @@ DEPENDENCIES minitest (~> 5.18.0) mocha (~> 2.0.2) rake (~> 13.0.6) - rubocop (= 1.49.0) + rubocop (= 1.51.0) rubocop-github (~> 0.20.0) BUNDLED WITH diff --git a/erblint-github.gemspec b/erblint-github.gemspec index 8bf7cb3..136fafc 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.49.0" + s.add_development_dependency "rubocop", "= 1.51.0" s.add_development_dependency "rubocop-github", "~> 0.20.0" s.metadata["rubygems_mfa_required"] = "true" end From b7933bd18d0d31bf5305aaaaa8b874e87461fbe3 Mon Sep 17 00:00:00 2001 From: Lindsey Wild <35239154+lindseywild@users.noreply.github.com> Date: Fri, 2 Jun 2023 11:26:23 +0000 Subject: [PATCH 10/19] fixes rubocop errors --- .rubocop.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index 7edaeb1..cb15fdd 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -8,3 +8,6 @@ AllCops: Style/Documentation: Enabled: false + +Gemspec/DevelopmentDependencies: + EnforcedStyle: gemspec \ No newline at end of file From 70080e32b5b43d8cb6ced514b3e6aab01d12e4f4 Mon Sep 17 00:00:00 2001 From: Lindsey Wild <35239154+lindseywild@users.noreply.github.com> Date: Fri, 2 Jun 2023 07:28:19 -0400 Subject: [PATCH 11/19] Update .rubocop.yml --- .rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index cb15fdd..63ae720 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -10,4 +10,4 @@ Style/Documentation: Enabled: false Gemspec/DevelopmentDependencies: - EnforcedStyle: gemspec \ No newline at end of file + EnforcedStyle: gemspec From e354247e1062a515756b6bc027d23ca5319c8230 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 04:05:06 +0000 Subject: [PATCH 12/19] Update rubocop requirement from = 1.51.0 to = 1.52.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.51.0...v1.52.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 323cd5a..8933c0b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -64,7 +64,7 @@ GEM rake (13.0.6) regexp_parser (2.8.0) rexml (3.2.5) - rubocop (1.51.0) + rubocop (1.52.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) @@ -103,7 +103,7 @@ DEPENDENCIES minitest (~> 5.18.0) mocha (~> 2.0.2) rake (~> 13.0.6) - rubocop (= 1.51.0) + rubocop (= 1.52.0) rubocop-github (~> 0.20.0) BUNDLED WITH diff --git a/erblint-github.gemspec b/erblint-github.gemspec index 136fafc..9732296 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.51.0" + s.add_development_dependency "rubocop", "= 1.52.0" s.add_development_dependency "rubocop-github", "~> 0.20.0" s.metadata["rubygems_mfa_required"] = "true" end From d86abedf87521f8ff8312a1d4102207411b2153b Mon Sep 17 00:00:00 2001 From: Kate Higa <16447748+khiga8@users.noreply.github.com> Date: Thu, 8 Jun 2023 18:23:27 -0400 Subject: [PATCH 13/19] Remove counter config code --- README.md | 28 ---------------- lib/erblint-github/linters/custom_helpers.rb | 33 ------------------- .../avoid_both_disabled_and_aria_disabled.rb | 9 ----- .../accessibility/avoid_generic_link_text.rb | 8 ----- .../accessibility/disabled_attribute.rb | 14 -------- .../github/accessibility/iframe_has_title.rb | 9 ----- .../github/accessibility/image_has_alt.rb | 9 ----- .../github/accessibility/link_has_href.rb | 9 ----- .../nested_interactive_elements.rb | 8 ----- .../no_aria_hidden_on_focusable.rb | 9 ----- .../accessibility/no_aria_label_misuse.rb | 8 ----- .../accessibility/no_positive_tab_index.rb | 9 ----- .../accessibility/no_redundant_image_alt.rb | 9 ----- .../accessibility/no_title_attribute.rb | 9 ----- .../accessibility/svg_has_accessible_text.rb | 9 ----- 15 files changed, 180 deletions(-) diff --git a/README.md b/README.md index 597f023..48444ec 100644 --- a/README.md +++ b/README.md @@ -73,34 +73,6 @@ linters: - [GitHub::Accessibility::NoTitleAttribute](./docs/rules/accessibility/no-title-attribute.md) - [GitHub::Accessibility::SvgHasAccessibleText](./docs/rules/accessibility/svg-has-accessible-text.md) -## Disabling a rule (Deprecated) - -_This is a soon-to-be deprecated feature. Do not use. See [migration guide](./docs/counter-migration-guide.md)_ - -`erblint` does not natively support rule disables. At GitHub, we've implemented these rules in a way to allow rules to be disabled at an offense-level via counters or disabled at a file-level because often times, we want to enable a rule but aren't able to address all offenses at once. We achieve this in one of two ways. - -Rules that are marked as `Counter` can be disabled by adding a comment with the offense count that matches the number of offenses within the file like: - -```.html.erb -<%# erblint:counter GitHub::Accessibility::LinkHasHrefCounter 1 %> -``` - -In this comment example, when a new `LinkHasHref` offense has been added, the counter will need to be bumped up to 2. More recent rules use a `Counter` format. - -If you are enabling a rule for the first time and your codebase has a lot of offenses, you can use the `-a` command to automatically add these counter comments in the appropriate places. - -``` -bundle exec erblint app/views app/components -a -``` - -Rules that are not marked as `Counter` like `NoRedundantImageAlt` are considered to be legacy format. We are in the process of migrating these to counters. These rules can still be disabled at the file-level by adding this comment at the top of the file: - -```.html.erb -<%# erblint:disable GitHub::Accessibility::NoRedundantImageAlt %> -``` - -However, unlike a counter, any subsequent offenses introduced to the file will not raise. - ## Testing ``` diff --git a/lib/erblint-github/linters/custom_helpers.rb b/lib/erblint-github/linters/custom_helpers.rb index 24826ea..8563a59 100644 --- a/lib/erblint-github/linters/custom_helpers.rb +++ b/lib/erblint-github/linters/custom_helpers.rb @@ -8,39 +8,6 @@ module Linters module CustomHelpers INTERACTIVE_ELEMENTS = %w[button summary input select textarea a].freeze - def counter_correct?(processed_source) - comment_node = nil - expected_count = 0 - rule_name = simple_class_name - offenses_count = @offenses.length - - processed_source.parser.ast.descendants(:erb).each do |node| - indicator_node, _, code_node, = *node - indicator = indicator_node&.loc&.source - comment = code_node&.loc&.source&.strip - - if indicator == "#" && comment.start_with?("erblint:counter") && comment.match(rule_name) - comment_node = node - expected_count = comment.match(/\s(\d+)\s?$/)[1].to_i - end - end - - 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 - end - - first_offense = @offenses[0] - - if comment_node.nil? - add_offense(processed_source.to_source_range(first_offense.source_range), "#{rule_name}: If you must, add <%# erblint:disable #{rule_name} %> at the end of the offending line to bypass this check. See https://github.com/shopify/erb-lint#disable-rule-at-offense-level", "<%# erblint:disable #{rule_name} %>") - else - clear_offenses - add_offense(processed_source.to_source_range(comment_node.loc), "Incorrect erblint:counter number for #{rule_name}. Expected: #{expected_count}, actual: #{offenses_count}.", "<%# erblint:counter #{rule_name}Counter #{offenses_count} %>") if expected_count != offenses_count - end - end - def generate_offense(klass, processed_source, tag, message = nil, replacement = nil) message ||= klass::MESSAGE message += "\nLearn more at https://github.com/github/erblint-github#rules.\n" diff --git a/lib/erblint-github/linters/github/accessibility/avoid_both_disabled_and_aria_disabled.rb b/lib/erblint-github/linters/github/accessibility/avoid_both_disabled_and_aria_disabled.rb index 56324e7..25d4e74 100644 --- a/lib/erblint-github/linters/github/accessibility/avoid_both_disabled_and_aria_disabled.rb +++ b/lib/erblint-github/linters/github/accessibility/avoid_both_disabled_and_aria_disabled.rb @@ -13,11 +13,6 @@ class AvoidBothDisabledAndAriaDisabled < Linter ELEMENTS_WITH_NATIVE_DISABLED_ATTRIBUTE_SUPPORT = %w[button fieldset input optgroup option select textarea].freeze MESSAGE = "[aria-disabled] may be used in place of native HTML [disabled] to allow tab-focus on an otherwise ignored element. Setting both attributes is contradictory." - class ConfigSchema < LinterConfig - property :counter_enabled, accepts: [true, false], default: false, reader: :counter_enabled? - end - self.config_schema = ConfigSchema - def run(processed_source) tags(processed_source).each do |tag| next if tag.closing? @@ -26,10 +21,6 @@ def run(processed_source) generate_offense(self.class, processed_source, tag) end - - if @config.counter_enabled? - counter_correct?(processed_source) - end end end end diff --git a/lib/erblint-github/linters/github/accessibility/avoid_generic_link_text.rb b/lib/erblint-github/linters/github/accessibility/avoid_generic_link_text.rb index 9d24c6b..ac24f73 100644 --- a/lib/erblint-github/linters/github/accessibility/avoid_generic_link_text.rb +++ b/lib/erblint-github/linters/github/accessibility/avoid_generic_link_text.rb @@ -22,11 +22,6 @@ class AvoidGenericLinkText < Linter MESSAGE = "Avoid using generic link text such as #{BANNED_GENERIC_TEXT.join(', ')} which do not make sense in isolation." - class ConfigSchema < LinterConfig - property :counter_enabled, accepts: [true, false], default: false, reader: :counter_enabled? - end - self.config_schema = ConfigSchema - def run(processed_source) processed_source.ast.children.each_with_index do |node, index| next unless node.methods.include?(:type) && node.type == :text @@ -98,9 +93,6 @@ def run(processed_source) banned_text = nil end end - if @config.counter_enabled? - counter_correct?(processed_source) - end end private diff --git a/lib/erblint-github/linters/github/accessibility/disabled_attribute.rb b/lib/erblint-github/linters/github/accessibility/disabled_attribute.rb index 6ad9fda..475efca 100644 --- a/lib/erblint-github/linters/github/accessibility/disabled_attribute.rb +++ b/lib/erblint-github/linters/github/accessibility/disabled_attribute.rb @@ -13,16 +13,6 @@ class DisabledAttribute < Linter VALID_DISABLED_TAGS = %w[button input textarea option select fieldset optgroup task-lists].freeze MESSAGE = "`disabled` is only valid on #{VALID_DISABLED_TAGS.join(', ')}." - class ConfigSchema < LinterConfig - property :counter_enabled, accepts: [true, false], default: false, reader: :counter_enabled? - end - self.config_schema = ConfigSchema - - class ConfigSchema < LinterConfig - property :counter_enabled, accepts: [true, false], default: false, reader: :counter_enabled? - end - self.config_schema = ConfigSchema - def run(processed_source) tags(processed_source).each do |tag| next if tag.closing? @@ -31,10 +21,6 @@ def run(processed_source) generate_offense(self.class, processed_source, tag) end - - if @config.counter_enabled? - counter_correct?(processed_source) - end end end end diff --git a/lib/erblint-github/linters/github/accessibility/iframe_has_title.rb b/lib/erblint-github/linters/github/accessibility/iframe_has_title.rb index 74af566..6cf6a45 100644 --- a/lib/erblint-github/linters/github/accessibility/iframe_has_title.rb +++ b/lib/erblint-github/linters/github/accessibility/iframe_has_title.rb @@ -13,11 +13,6 @@ class IframeHasTitle < Linter MESSAGE = "`