File tree Expand file tree Collapse file tree 8 files changed +8
-8
lines changed Expand file tree Collapse file tree 8 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ def directive_on_comment_line?(comment)
130
130
def each_directive
131
131
return if processed_source . comments . nil?
132
132
133
- processed_source . each_comment do |comment |
133
+ processed_source . comments . each do |comment |
134
134
directive = directive_parts ( comment )
135
135
next unless directive
136
136
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ class CommentIndentation < Cop
39
39
'instead of %<correct_comment_indentation>d).'
40
40
41
41
def investigate ( processed_source )
42
- processed_source . each_comment { |comment | check ( comment ) }
42
+ processed_source . comments . each { |comment | check ( comment ) }
43
43
end
44
44
45
45
def autocorrect ( comment )
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ class LeadingCommentSpace < Cop
55
55
MSG = 'Missing space after `#`.'
56
56
57
57
def investigate ( processed_source )
58
- processed_source . each_comment do |comment |
58
+ processed_source . comments . each do |comment |
59
59
next unless /\A #+[^#\s =:+-]/ . match? ( comment . text )
60
60
next if comment . loc . line == 1 && allowed_on_first_line? ( comment )
61
61
next if doxygen_comment_style? ( comment )
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class DepartmentName < Base
20
20
DISABLING_COPS_CONTENT_TOKEN = %r{[A-z]+/[A-z]+|all} . freeze
21
21
22
22
def on_new_investigation
23
- processed_source . each_comment do |comment |
23
+ processed_source . comments . each do |comment |
24
24
next if comment . text !~ DISABLE_COMMENT_FORMAT
25
25
26
26
offset = Regexp . last_match ( 1 ) . length
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class AsciiComments < Base
21
21
MSG = 'Use only ascii symbols in comments.'
22
22
23
23
def on_new_investigation
24
- processed_source . each_comment do |comment |
24
+ processed_source . comments . each do |comment |
25
25
next if comment . text . ascii_only?
26
26
next if only_allowed_non_ascii_chars? ( comment . text )
27
27
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ class BlockComments < Base
25
25
END_LENGTH = "\n =end" . length
26
26
27
27
def on_new_investigation
28
- processed_source . each_comment do |comment |
28
+ processed_source . comments . each do |comment |
29
29
next unless comment . document?
30
30
31
31
add_offense ( comment ) do |corrector |
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class CommentedKeyword < Cop
38
38
'`%<keyword>s` keyword.'
39
39
40
40
def investigate ( processed_source )
41
- processed_source . each_comment do |comment |
41
+ processed_source . comments . each do |comment |
42
42
add_offense ( comment ) if offensive? ( comment )
43
43
end
44
44
end
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class InlineComment < Base
21
21
MSG = 'Avoid trailing inline comments.'
22
22
23
23
def on_new_investigation
24
- processed_source . each_comment do |comment |
24
+ processed_source . comments . each do |comment |
25
25
next if comment_line? ( processed_source [ comment . loc . line - 1 ] ) ||
26
26
comment . text . match? ( /\A # rubocop:(enable|disable)/ )
27
27
You can’t perform that action at this time.
0 commit comments