Class: RuboCop::Cop::RSpec::AlignRightLetBrace
- Inherits:
-
Cop
- Object
- WorkaroundCop
- Cop
- RuboCop::Cop::RSpec::AlignRightLetBrace
show all
- Defined in:
- lib/rubocop/cop/rspec/align_right_let_brace.rb
Overview
Checks that right braces for adjacent single line lets are aligned.
Constant Summary
collapse
- MSG =
'Align right let brace'.freeze
Constants inherited
from Cop
Cop::DEFAULT_CONFIGURATION
RSpec::Language::ALL
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Cop
inherited, #relevant_file?
Class Method Details
.autocorrect_incompatible_with ⇒ Object
23
24
25
|
# File 'lib/rubocop/cop/rspec/align_right_let_brace.rb', line 23
def self.autocorrect_incompatible_with
[Layout::]
end
|
Instance Method Details
#autocorrect(let) ⇒ Object
33
34
35
36
37
38
39
40
|
# File 'lib/rubocop/cop/rspec/align_right_let_brace.rb', line 33
def autocorrect(let)
lambda do |corrector|
corrector.insert_before(
let.loc.end,
token_aligner.indent_for(let)
)
end
end
|
#investigate(_) ⇒ Object
27
28
29
30
31
|
# File 'lib/rubocop/cop/rspec/align_right_let_brace.rb', line 27
def investigate(_)
token_aligner.offending_tokens.each do |let|
add_offense(let, location: :end)
end
end
|