File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
lib/erblint-github/linters Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -36,11 +36,12 @@ def counter_correct?(processed_source)
3636 processed_source . parser . ast . descendants ( :erb ) . each do |node |
3737 indicator_node , _ , code_node , = *node
3838 indicator = indicator_node &.loc &.source
39- comment = code_node &.loc &.source &.strip
39+ comment = code_node &.loc &.source
40+ stripped_comment = comment &.strip
4041
41- if indicator == "#" && comment . start_with? ( "erblint:counter" ) && comment . match ( rule_name )
42+ if indicator == "#" && stripped_comment . start_with? ( "erblint:counter" ) && stripped_comment . match ( rule_name )
4243 comment_node = node
43- expected_count = comment . match ( /\s (\d +)\s ?$/ ) [ 1 ] . to_i
44+ expected_count = stripped_comment . match ( /\s (\d +)\s ?$/ ) [ 1 ] . to_i
4445 end
4546 end
4647
You can’t perform that action at this time.
0 commit comments