Class: Shirobai::Cop::Rails::IndexWith

Inherits:
RuboCop::Cop::Base
  • Object
show all
Extended by:
RuboCop::Cop::AutoCorrector, RuboCop::Cop::TargetRailsVersion
Includes:
IndexMethodSupport
Defined in:
lib/shirobai/cop/rails/index_with.rb

Overview

Drop-in Rust-backed reimplementation of Rails/IndexWith (rubocop-rails 2.35.5), Architecture B.

Same harness as IndexBy (shared candidate list, IndexMethodSupport relocation + stock detection/autocorrect). The def_node_matcher patterns below are stock's IndexWith matchers (value-transform: key == element). The minimum_target_rails_version 6.0 gate is stock's, driven by the same requires_gem / TargetRailsVersion machinery the runner already consults, so the wrapper is enabled on exactly the same targets as stock.

Class Method Summary collapse

Methods included from IndexMethodSupport

included, #investigate_block, #investigate_csend, #investigate_send, #on_new_investigation

Class Method Details

.badgeObject



26
# File 'lib/shirobai/cop/rails/index_with.rb', line 26

def self.badge = RuboCop::Cop::Badge.parse(cop_name)

.bundle_args(_config) ⇒ Object



28
29
30
# File 'lib/shirobai/cop/rails/index_with.rb', line 28

def self.bundle_args(_config)
  []
end

.cop_nameObject



25
# File 'lib/shirobai/cop/rails/index_with.rb', line 25

def self.cop_name = "Rails/IndexWith"