Module: Shirobai::Cop::RSpec::EmptyLineSeparationSupport
- Includes:
- RuboCop::Cop::RangeHelp
- Included in:
- EmptyLineAfterExample, EmptyLineAfterExampleGroup, EmptyLineAfterFinalLet, EmptyLineAfterHook, EmptyLineAfterSubject
- Defined in:
- lib/shirobai/cop/rspec/empty_line_separation_support.rb
Overview
Shared Ruby side of the RSpec empty-line family
(RSpec/EmptyLineAfter{Example,ExampleGroup,FinalLet,Hook,Subject}).
The Rust rule (rspec_empty_line.rs) owns concept classification,
last_child? and the heredoc-aware final_end_location(node).line; it
emits, per cop, [final_end_line, method_name] for every candidate that
clears those gates. This module replays the REST of stock's
EmptyLineSeparation#missing_separating_line verbatim — the trailing
comment walk, the enabled-# rubocop:enable directive tracking, the
blank-line suppression, the offense location and the "\n" autocorrect
— over the same ProcessedSource, so those parts are byte-for-byte
identical to stock.
Instance Method Summary collapse
-
#emit_empty_line_offenses(offenses) ⇒ Object
offensesis the Rust wire shape[[final_end_line, method_name], ...].
Instance Method Details
#emit_empty_line_offenses(offenses) ⇒ Object
offenses is the Rust wire shape [[final_end_line, method_name], ...]. The block turns a method name into the per-cop message.
23 24 25 26 27 |
# File 'lib/shirobai/cop/rspec/empty_line_separation_support.rb', line 23 def emit_empty_line_offenses(offenses) offenses.each do |final_end_line, method_name| (final_end_line, yield(method_name)) end end |