Skip to content

Enable Style/RedundantReturn cop

Igor Drozdov requested to merge id-redundant-return into master

Description of the proposal

  • Enables Style/RedundantReturn cop
  • Fixes existing Style/RedundantReturn offenses
# bad
def test
  return something
end

# bad
def test
  one
  two
  three
  return something
end

# good
def test
  return something if something_else
end

# good
def test
  if x
  elsif y
  else
  end
end
Edited by Mayra Cabrera

Merge request reports

Loading