Module: RuboCop::Cop::DevDoc::HashPairRemoval

Included in:
Migration::NoBulkChangeTable, Migration::RedundantReferenceIndex
Defined in:
lib/rubocop/cop/dev_doc/hash_pair_removal.rb

Overview

Shared autocorrect helper for deleting one pair from a method call's options hash. The removal range is anchored on neighbouring AST nodes rather than walked-over whitespace, so newlines between arguments are handled without corrupting the code.

Callers must skip the correction when pair_removal_range returns nil or when the range crosses a comment (crosses_comment?) — deleting a range that overlaps a comment would corrupt it.