Class: Shirobai::Cop::RSpec::EmptyLineAfterFinalLet

Inherits:
RuboCop::Cop::Base
  • Object
show all
Extended by:
RuboCop::Cop::AutoCorrector
Includes:
BundleEligible, EmptyLineSeparationSupport
Defined in:
lib/shirobai/cop/rspec/empty_line_after_final_let.rb

Overview

Drop-in Rust reimplementation of RSpec/EmptyLineAfterFinalLet (rubocop-rspec 3.10.2).

For every plain-block example/shared group or include_* block, the Rust rule finds the last let? among its direct body children (block form or the let(:x, &blk) send form) and flags it when it is not the body's last child. Config-less.

Constant Summary collapse

MSG =
"Add an empty line after the last `%<let>s`."

Class Method Summary collapse

Instance Method Summary collapse

Methods included from EmptyLineSeparationSupport

#emit_empty_line_offenses

Class Method Details

.badgeObject



21
# File 'lib/shirobai/cop/rspec/empty_line_after_final_let.rb', line 21

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

.bundle_args(_config) ⇒ Object



23
24
25
# File 'lib/shirobai/cop/rspec/empty_line_after_final_let.rb', line 23

def self.bundle_args(_config)
  []
end

.cop_nameObject



20
# File 'lib/shirobai/cop/rspec/empty_line_after_final_let.rb', line 20

def self.cop_name = "RSpec/EmptyLineAfterFinalLet"

Instance Method Details

#on_new_investigationObject



27
28
29
30
31
# File 'lib/shirobai/cop/rspec/empty_line_after_final_let.rb', line 27

def on_new_investigation
  emit_empty_line_offenses(resolved_offenses) do |method|
    format(MSG, let: method)
  end
end