Skip to content

Commit

Permalink
Merge pull request #1959 from rubocop/fix-RedundantSourceRange-offenses
Browse files Browse the repository at this point in the history
Fix InternalAffairs/RedundantSourceRange offenses
  • Loading branch information
bquorning authored Sep 18, 2024
2 parents 16cf19c + f4f698c commit 5b91d18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/rubocop/cop/rspec/change_by_zero.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ def on_send(node)
# rubocop:disable Metrics/MethodLength
def register_offense(node, change_node)
if compound_expectations?(node)
add_offense(node.source_range,
add_offense(node,
message: message_compound(change_node)) do |corrector|
autocorrect_compound(corrector, node)
end
else
add_offense(node.source_range,
add_offense(node,
message: message(change_node)) do |corrector|
autocorrect(corrector, node, change_node)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/expect_actual.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def on_send(node) # rubocop:disable Metrics/MethodLength
expect_literal(node) do |actual, send_node, matcher, expected|
next if SKIPPED_MATCHERS.include?(matcher)

add_offense(actual.source_range) do |corrector|
add_offense(actual) do |corrector|
next unless CORRECTABLE_MATCHERS.include?(matcher)
next if literal?(expected)

Expand Down

0 comments on commit 5b91d18

Please sign in to comment.