Class: RuboCop::Cop::RSpec::ScatteredLet
- Inherits:
-
Object
- Object
- RuboCop::Cop::RSpec::ScatteredLet
- Defined in:
- lib/rubocop/cop/rspec/scattered_let.rb
Overview
Patches the upstream ‘RSpec/ScatteredLet` cop so that Sorbet `sig` declarations attached to `let`/`let!` blocks (Sorbet’s RSpec mode) do not interrupt the consecutive-let chain.
Without this patch the upstream cop flags valid ‘sig`+`let` arrangements because the intervening `sig` block breaks the consecutive-sibling check. (The sig-aware `MoveNode` patch in `lib/rubocop/gusto/move_node_patch.rb` handles dragging the `sig` along during autocorrect.)
Instance Method Summary collapse
Instance Method Details
#sig_block?(node) ⇒ Object
32 33 34 |
# File 'lib/rubocop/cop/rspec/scattered_let.rb', line 32 def_node_matcher :sig_block?, <<~PATTERN (block (send nil? :sig) _ _) PATTERN |