diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..2f2242a --- /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 \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3963d08..fac6b77 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,10 +13,10 @@ jobs: strategy: matrix: ruby: - - '2.7' + - '3.0' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/Gemfile.lock b/Gemfile.lock index 3ef7f9f..1a569d8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,100 +1,119 @@ PATH remote: . specs: - rubocop-rails-accessibility (0.2.0) + rubocop-rails-accessibility (1.0.0) rubocop (>= 1.0.0) GEM remote: https://rubygems.org/ specs: - actionview (7.0.3.1) - activesupport (= 7.0.3.1) + actionview (7.1.3) + activesupport (= 7.1.3) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activesupport (7.0.3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activesupport (7.1.3) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) ast (2.4.2) + base64 (0.2.0) + bigdecimal (3.1.6) builder (3.2.4) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.3) + connection_pool (2.4.1) crass (1.0.6) - diff-lcs (1.5.0) - erubi (1.11.0) - i18n (1.12.0) + diff-lcs (1.5.1) + drb (2.2.0) + ruby2_keywords + erubi (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) - json (2.6.2) - loofah (2.18.0) + json (2.7.1) + language_server-protocol (3.17.0.3) + loofah (2.22.0) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - minitest (5.16.3) - nokogiri (1.13.8-arm64-darwin) + nokogiri (>= 1.12.0) + minitest (5.21.2) + mutex_m (0.2.0) + nokogiri (1.15.5-arm64-darwin) racc (~> 1.4) - nokogiri (1.13.8-x86_64-darwin) + nokogiri (1.15.5-x86_64-darwin) racc (~> 1.4) - nokogiri (1.13.8-x86_64-linux) + nokogiri (1.15.5-x86_64-linux) racc (~> 1.4) - parallel (1.22.1) - parser (3.1.2.0) + parallel (1.24.0) + parser (3.3.0.5) ast (~> 2.4.1) - racc (1.6.0) - rack (2.2.4) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + racc + racc (1.7.3) + rack (3.0.8) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.4.3) - loofah (~> 2.3) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) rainbow (3.1.1) - rake (13.0.6) - regexp_parser (2.5.0) - rexml (3.2.5) - rspec (3.11.0) - rspec-core (~> 3.11.0) - rspec-expectations (~> 3.11.0) - rspec-mocks (~> 3.11.0) - rspec-core (3.11.0) - rspec-support (~> 3.11.0) - rspec-expectations (3.11.0) + rake (13.1.0) + regexp_parser (2.9.0) + rexml (3.2.6) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-mocks (3.11.1) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-support (3.11.0) - rubocop (1.31.2) + rspec-support (~> 3.13.0) + rspec-support (3.13.0) + rubocop (1.60.2) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.18.0, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.19.1) - parser (>= 3.1.1.0) - rubocop-github (0.18.0) - rubocop (>= 1.0.0) - rubocop-performance - rubocop-rails - rubocop-performance (1.14.3) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - rubocop-rails (2.15.2) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-github (0.20.0) + rubocop (>= 1.37) + rubocop-performance (>= 1.15) + rubocop-rails (>= 2.17) + rubocop-performance (1.20.2) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rails (2.23.1) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 1.7.0, < 2.0) - ruby-progressbar (1.11.0) - tzinfo (2.0.5) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.2.0) + unicode-display_width (2.5.0) PLATFORMS arm64-darwin-21 x86_64-darwin-19 + x86_64-darwin-21 x86_64-linux DEPENDENCIES @@ -108,4 +127,4 @@ DEPENDENCIES rubocop-rails-accessibility! BUNDLED WITH - 2.3.22 + 2.3.7 diff --git a/lib/rubocop/rails_accessibility/version.rb b/lib/rubocop/rails_accessibility/version.rb index c1fdb3d..c80bd19 100644 --- a/lib/rubocop/rails_accessibility/version.rb +++ b/lib/rubocop/rails_accessibility/version.rb @@ -2,6 +2,6 @@ module RuboCop module RailsAccessibility - VERSION = "0.2.0" + VERSION = "1.0.0" end end diff --git a/rubocop-rails-accessibility.gemspec b/rubocop-rails-accessibility.gemspec index a8b1545..34cc0df 100644 --- a/rubocop-rails-accessibility.gemspec +++ b/rubocop-rails-accessibility.gemspec @@ -11,7 +11,7 @@ Gem::Specification.new do |spec| spec.summary = "Custom RuboCop rules for Rails Accessibility." spec.homepage = "https://github.com/github/rubocop-rails-accessibility" spec.license = "MIT" - spec.required_ruby_version = ">= 2.7.0" + spec.required_ruby_version = ">= 3.0.0" spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = spec.homepage diff --git a/test/cop_test.rb b/test/cop_test.rb index 4af051c..bb9e298 100644 --- a/test/cop_test.rb +++ b/test/cop_test.rb @@ -3,7 +3,7 @@ require "action_view" require "minitest" -class CopTest < MiniTest::Test +class CopTest < Minitest::Test def cop_class raise NotImplementedError end @@ -11,13 +11,13 @@ def cop_class attr_reader :cop def setup - config = RuboCop::Config.new - @cop = cop_class.new(config) + @config = RuboCop::Config.new + @cop = cop_class.new(@config) end def investigate(cop, src, filename = nil) processed_source = RuboCop::ProcessedSource.new(src, RUBY_VERSION.to_f, filename) - team = RuboCop::Cop::Team.new([cop], nil, raise_error: true) + team = RuboCop::Cop::Team.new([cop], @config, raise_error: true) report = team.investigate(processed_source) report.offenses end diff --git a/test/test_image_has_alt.rb b/test/test_image_has_alt.rb index 7e79b47..5cf5fee 100644 --- a/test/test_image_has_alt.rb +++ b/test/test_image_has_alt.rb @@ -15,7 +15,7 @@ def test_image_has_alt_offense ERB assert_equal 1, offenses.count - assert_equal "Images should have an alt prop with meaningful text or an empty string for decorative images", + assert_equal "RailsAccessibility/ImageHasAlt: Images should have an alt prop with meaningful text or an empty string for decorative images", offenses[0].message end diff --git a/test/test_no_positive_tabindex.rb b/test/test_no_positive_tabindex.rb index cfb611b..e8a5165 100644 --- a/test/test_no_positive_tabindex.rb +++ b/test/test_no_positive_tabindex.rb @@ -15,7 +15,7 @@ def test_no_positive_tabindex_alt_offense ERB assert_equal 1, offenses.count - assert_equal "Positive tabindex is error-prone and often inaccessible.", offenses[0].message + assert_equal "RailsAccessibility/NoPositiveTabindex: Positive tabindex is error-prone and often inaccessible.", offenses[0].message end def test_no_positive_tabindex_alt_no_offense diff --git a/test/test_no_redundant_image_alt.rb b/test/test_no_redundant_image_alt.rb index 01b5fdf..ffc1418 100644 --- a/test/test_no_redundant_image_alt.rb +++ b/test/test_no_redundant_image_alt.rb @@ -15,7 +15,7 @@ def test_no_redundant_image_alt_offense ERB assert_equal 1, offenses.count - assert_equal "Alt prop should not contain `image` or `picture` as screen readers already announce the element as an image", + assert_equal "RailsAccessibility/NoRedundantImageAlt: Alt prop should not contain `image` or `picture` as screen readers already announce the element as an image", offenses[0].message end
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: