You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed that the Style/RedundantBegin cop sometimes has two undesirable actions:
It sometimes removes blank lines
It sometimes causes unusual indentation, i.e. indenting the raise clause by a single space.
The following rspec test demonstrates both of these anomalies. This spec could be added to spec/rubocop/cop/style/redundant_begin_spec.rb:
it"doesn't modify spacing when auto-correcting"dosrc=""" def method begin BlockA do |strategy| foo end BlockB do |portfolio| foo end rescue => e bar end end """result_src=""" def method BlockA do |strategy| foo end BlockB do |portfolio| foo end rescue => e bar end """new_source=autocorrect_source(cop,src)expect(new_source).toeq(result_src)end
The text was updated successfully, but these errors were encountered:
I've noticed that the Style/RedundantBegin cop sometimes has two undesirable actions:
raise
clause by a single space.The following rspec test demonstrates both of these anomalies. This spec could be added to
spec/rubocop/cop/style/redundant_begin_spec.rb
:The text was updated successfully, but these errors were encountered: