Class: RuboCop::Cop::RSpec::AlignLeftLetBrace
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/rspec/align_left_let_brace.rb
Overview
Checks that left braces for adjacent single line lets are aligned.
Constant Summary collapse
- MSG =
'Align left let brace'
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
Methods included from RSpec::Language
#example?, #example_group?, #example_group_with_body?, #explicit_rspec?, #hook?, #include?, #let?, #rspec?, #shared_group?, #spec_group?, #subject?
Class Method Details
.autocorrect_incompatible_with ⇒ Object
24 25 26 |
# File 'lib/rubocop/cop/rspec/align_left_let_brace.rb', line 24 def self.autocorrect_incompatible_with [Layout::ExtraSpacing] end |
Instance Method Details
#on_new_investigation ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rubocop/cop/rspec/align_left_let_brace.rb', line 28 def on_new_investigation super return if processed_source.blank? token_aligner.offending_tokens.each do |let| add_offense(let.loc.begin) do |corrector| corrector.insert_before( let.loc.begin, token_aligner.indent_for(let) ) end end end |