Add custom cop to ban head and return

What does this MR do and why?

Creates a custom cop Style/HeadAndReturn that bans the head ... and return pattern and autocorrects it to return head ... .

New files :

  • .rubocop/cops/style/head_and_return.rb
  • spec/rubocop/cops/style/head_and_return_spec.rb

Closes #479 (closed)

Screenshots or screen recordings

Before After

Validation steps

/cc @leetickett-gitlab

Edited by Lee Tickett

Merge request reports

Loading
Loading