File tree Expand file tree Collapse file tree 4 files changed +28
-3
lines changed
Expand file tree Collapse file tree 4 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ inherit_gem :
3+ erblint-github :
4+ - config/accessibility.yml
Original file line number Diff line number Diff line change 1+ require "erblint-github/linters"
Original file line number Diff line number Diff line change @@ -5,9 +5,7 @@ def setup
55 @linter = linter_class &.new ( file_loader , linter_class . config_schema . new )
66 end
77
8- def linter_class
9- raise NotImplementedError
10- end
8+ def linter_class ; end
119
1210 def offenses
1311 @linter . offenses
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require "test_helper"
4+
5+ class RecommendedSetupWorksTest < LinterTestCase
6+ # The ability to share rules and configs from other gems in erb_lint is not well-documented.
7+ # This test validates that our recommended setup works.
8+ def test_asserts_recommended_setup_works
9+ erb_lint_config = ERBLint ::RunnerConfig . new ( file_loader . yaml ( ".erb-lint.yml" ) , file_loader )
10+
11+ rules_enabled_in_accessibility_config = 0
12+ erb_lint_config . to_hash [ "linters" ] . each do |linter |
13+ if linter [ 0 ] . include? ( "GitHub::Accessibility" ) && linter [ 1 ] [ "enabled" ] == true
14+ rules_enabled_in_accessibility_config += 1
15+ end
16+ end
17+ known_linter_names ||= ERBLint ::LinterRegistry . linters . map ( &:simple_name )
18+
19+ assert_equal 15 , rules_enabled_in_accessibility_config
20+ assert_equal 15 , known_linter_names . count { |linter | linter . include? ( "GitHub::Accessibility" ) }
21+ end
22+ end
You can’t perform that action at this time.
0 commit comments