Style Change Proposal: Add Rubocop ReturnNil cop

Description of the proposal

Spawned from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24902#note_139520959

I had the following:

return nil unless tracing_url_enabled?

@grzesiek reviewed with:

nil is redundant here.

Which made me wonder why we're not enforcing this with a cop instead of relying on maintainers to tell us.

Bad Style ❌

return nil unless condition

Good Style ✅

return unless condition
  • Mention the proposal in the next backend weekly call and the #backend channel to encourage contribution
  • Proceed with the proposal once 50% of the maintainers have weighed in, and 80% of the votes are 👍
  • Once approved, mention it again in the next backend weekly call and the #backend channel

Maintainer Voting

Maintainer Nays to the left Ayes to the right
@ayufan 👍
@dbalexandre 👍
@DouweM 👍
@dzaporozhets 👍
@godfat
@grzesiek 👍
@nick.thomas 👍
@rspeicher 👍
@rymai 👍
@smcgivern 👍
@stanhu 👍

/cc @gitlab-org/maintainers/rails-backend

Merge Request: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/25034

Edited Mar 06, 2019 by Andrew Newdigate
Assignee Loading
Time tracking Loading