Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New return nil cop #4508

Closed
Ana06 opened this issue Jun 13, 2017 · 4 comments
Closed

New return nil cop #4508

Ana06 opened this issue Jun 13, 2017 · 4 comments
Labels
feature request good first issue Easy task, suitable for newcomers to the project

Comments

@Ana06
Copy link
Contributor

Ana06 commented Jun 13, 2017

return and return nil are the same thing, so return nil should be avoided. A new cop to check this would be great! 😉

@rrosenblum
Copy link
Contributor

This cop should be configurable to support the implicit nil (return) and the explicit nil (return nil).

@Drenmi Drenmi added feature request good first issue Easy task, suitable for newcomers to the project labels Jul 2, 2017
@danielkman
Copy link

Hey, I'd like to try and submit a PR for it

@pocke
Copy link
Collaborator

pocke commented Aug 12, 2017

#4638
@danielkman Thanks, but a pull-request for this issue is already opened.

@bbatsov
Copy link
Collaborator

bbatsov commented Aug 12, 2017

return and return nil are the same thing, so return nil should be avoided. A new cop to check this would be great!

I can see why some people would want to make this uniform, but I for instance always use return when I just want to get out from some place in a method (meaning the return is in void context and no one cares about it) and return nil if I actually want to explicitly return nil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request good first issue Easy task, suitable for newcomers to the project
Projects
None yet
Development

No branches or pull requests

6 participants