Class: Shirobai::Cop::RSpec::EmptyLineAfterSubject

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

Overview

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

Flags every plain-block subject/subject! that is inside an example group (its outermost enclosing top-level statement is a spec group) and has a following sibling in a :begin sequence. Config-less.

Constant Summary collapse

MSG =
"Add an empty line after `%<subject>s`."

Class Method Summary collapse

Instance Method Summary collapse

Methods included from EmptyLineSeparationSupport

#emit_empty_line_offenses

Class Method Details

.badgeObject



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

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

.bundle_args(_config) ⇒ Object



22
23
24
# File 'lib/shirobai/cop/rspec/empty_line_after_subject.rb', line 22

def self.bundle_args(_config)
  []
end

.cop_nameObject



19
# File 'lib/shirobai/cop/rspec/empty_line_after_subject.rb', line 19

def self.cop_name = "RSpec/EmptyLineAfterSubject"

Instance Method Details

#on_new_investigationObject



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

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