Sha256: f795e40be0d5959d53138ac7c7c4879ef4e456ea2ae1b9320db466d1ace6dd94
Contents?: true
Size: 865 Bytes
Versions: 23
Compression:
Stored size: 865 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module InternalAffairs # Checks for redundant arguments of `RuboCop::RSpec::ExpectOffense`'s methods. # # @example # # # bad # expect_no_offenses('code', keyword: keyword) # # # good # expect_no_offenses('code') # class RedundantExpectOffenseArguments < Base extend AutoCorrector MSG = 'Remove the redundant arguments.' RESTRICT_ON_SEND = %i[expect_no_offenses].freeze def on_send(node) return if node.arguments.one? || !node.arguments[1]&.hash_type? range = node.first_argument.source_range.end.join(node.last_argument.source_range.end) add_offense(range) do |corrector| corrector.remove(range) end end end end end end
Version data entries
23 entries across 23 versions & 5 rubygems