Skip to content

Commit 9a08fde

Browse files
marcandrebbatsov
authored andcommitted
Avoid use of ProcessedSource#commented?
1 parent 28eabb7 commit 9a08fde

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/rubocop/cop/mixin/check_line_breakable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def extract_breakable_node_from_elements(node, elements, max)
5959
return if safe_to_ignore?(node)
6060

6161
line = processed_source.lines[node.first_line - 1]
62-
return if processed_source.commented?(node.loc.begin)
62+
return if processed_source.line_with_comment?(node.loc.line)
6363
return if line.length <= max
6464

6565
extract_first_element_over_column_limit(node, elements, max)

lib/rubocop/cop/mixin/statement_modifier.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ def single_line_as_modifier?(node)
1919
def non_eligible_node?(node)
2020
node.modifier_form? ||
2121
node.nonempty_line_count > 3 ||
22-
processed_source.commented?(node.loc.end)
22+
processed_source.line_with_comment?(node.loc.last_line)
2323
end
2424

2525
def non_eligible_body?(body)
2626
body.nil? ||
2727
body.empty_source? ||
2828
body.begin_type? ||
29-
processed_source.commented?(body.source_range)
29+
processed_source.contains_comment?(body.source_range)
3030
end
3131

3232
def non_eligible_condition?(condition)

0 commit comments

Comments
 (0)