Skip to content

Commit 239f4e3

Browse files
committed
Suggest adding erblint:disable instead of erblint:counter
1 parent 0d789d2 commit 239f4e3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/erblint-github/linters/custom_helpers.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ def counter_correct?(processed_source)
3434
first_offense = @offenses[0]
3535

3636
if comment_node.nil?
37-
add_offense(processed_source.to_source_range(first_offense.source_range), "#{rule_name}: If you must, add <%# erblint:counter #{rule_name} #{offenses_count} %> to bypass this check.", "<%# erblint:counter #{rule_name} #{offenses_count} %>")
37+
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} %>")
3838
else
3939
clear_offenses
40-
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} #{offenses_count} %>") if expected_count != offenses_count
40+
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
4141
end
4242
end
4343

test/linters/accessibility/avoid_both_disabled_and_aria_disabled_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_adds_extra_offense_to_add_counter_comment_if_counter_config_enabled
4444
@linter.run(processed_source)
4545

4646
assert_equal @linter.offenses.count, 8
47-
assert_match(/If you must, add <%# erblint:counter GitHub::Accessibility::AvoidBothDisabledAndAriaDisabled 7 %> to bypass this check/, @linter.offenses.last.message)
47+
assert_match(/If you must, add <%# erblint:disable GitHub::Accessibility::AvoidBothDisabledAndAriaDisabled %> at the end of the offending line to bypass this check./, @linter.offenses.last.message)
4848
end
4949

5050
def test_does_not_raise_when_ignore_comment_with_correct_count_if_counter_enabled

0 commit comments

Comments
 (0)