fix whitespace removal, fix string concatenation

This commit is contained in:
Max Eisner 2022-08-10 22:20:33 +02:00
parent 8282b15a2a
commit 5b3f5dcbf2
No known key found for this signature in database
GPG Key ID: 4BF122C22879F0C8

View File

@ -519,10 +519,10 @@ module RuboCop
T.must(offenses[0...-1]).each do |node|
offending_node(node)
problem "Use a single `generate_completions_from_executable` call
combining all specified shells" do |corrector|
# adjust range by +1 to also include & remove trailing \n
corrector.replace(@offensive_node.source_range.adjust(end_pos: 1), "")
problem "Use a single `generate_completions_from_executable` " \
"call combining all specified shells." do |corrector|
# adjust range by -4 and +1 to also include & remove leading spaces and trailing \n
corrector.replace(@offensive_node.source_range.adjust(begin_pos: -4, end_pos: 1), "")
end
end