Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ GEM
erubi (1.13.0)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
json (2.7.5)
json (2.8.2)
language_server-protocol (3.17.0.3)
loofah (2.22.0)
crass (~> 1.0.2)
Expand All @@ -61,7 +61,7 @@ GEM
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
parallel (1.26.3)
parser (3.3.5.1)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
racc (1.8.1)
Expand All @@ -75,18 +75,18 @@ GEM
nokogiri (~> 1.14)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.2)
rubocop (1.68.0)
regexp_parser (2.9.3)
rubocop (1.69.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
rubocop-ast (>= 1.36.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.33.1)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.36.2)
parser (>= 3.3.1.0)
rubocop-github (0.20.0)
rubocop (>= 1.37)
Expand All @@ -104,7 +104,9 @@ GEM
smart_properties (1.17.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
unicode-display_width (3.1.2)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)

PLATFORMS
ruby
Expand All @@ -115,7 +117,7 @@ DEPENDENCIES
minitest (~> 5.25.1)
mocha (~> 2.6.0)
rake (~> 13.2.1)
rubocop (= 1.68.0)
rubocop (= 1.69.0)
rubocop-github (~> 0.20.0)

BUNDLED WITH
Expand Down
2 changes: 1 addition & 1 deletion erblint-github.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |s|
s.add_development_dependency "mocha", "~> 2.6.0"
s.add_development_dependency "rake", "~> 13.2.1"

s.add_development_dependency "rubocop", "= 1.68.0"
s.add_development_dependency "rubocop", "= 1.69.0"
s.add_development_dependency "rubocop-github", "~> 0.20.0"
s.metadata["rubygems_mfa_required"] = "true"

Expand Down
7 changes: 4 additions & 3 deletions lib/erblint-github/linters/custom_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ def counter_correct?(processed_source)
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
comment = code_node&.loc&.source
stripped_comment = comment&.strip

if indicator == "#" && comment.start_with?("erblint:counter") && comment.match(rule_name)
if indicator == "#" && stripped_comment.start_with?("erblint:counter") && stripped_comment.match(rule_name)
comment_node = node
expected_count = comment.match(/\s(\d+)\s?$/)[1].to_i
expected_count = stripped_comment.match(/\s(\d+)\s?$/)[1].to_i
end
end

Expand Down
Loading