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

Hound suggests renaming unused method arguments #821

Closed
georgebrock opened this issue Jun 16, 2015 · 4 comments
Closed

Hound suggests renaming unused method arguments #821

georgebrock opened this issue Jun 16, 2015 · 4 comments

Comments

@georgebrock
Copy link
Contributor

Hound suggests renaming unused method arguments, e.g.:

Unused method argument - job. If it's necessary, use _ or _job as an argument name to indicate that it won't be used.

This isn't in the thoughtbot Ruby style guide. The closest thing in the guides is for block parameters:

Use _ for unused block parameters.

@gylaz
Copy link
Member

gylaz commented Jun 16, 2015

I opened a PR for this thoughtbot/guides#335.

@gylaz
Copy link
Member

gylaz commented Jun 16, 2015

I'm thinking at the very least we want to be notified if a variable or argument is unused, because maybe someone forgot to remove it. Not sure if RuboCop supports a message to notify someone that something is unused.

@georgebrock
Copy link
Contributor Author

There's a separate notification for an unused variable, and I agree that one makes sense. I'd also be happy with a “this argument is unused, did you mean to remove it?” notification. It's the “you should prefix this” part that I disagree with.

@gylaz
Copy link
Member

gylaz commented Aug 19, 2015

This is now in the thoughtbot guides. Closing.

@gylaz gylaz closed this as completed Aug 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants