-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Lint/UnusedMethodArgument should be able to skip empty methods #1601
Comments
Makes sense. We can introduce a config option for this. On 27 January 2015 at 02:01, Ryan Davis [email protected] wrote:
|
This problem also occurs with empty blocks, especially in auto-generated configuration scripts that have lots of commented out option setting things you can do. |
So you would prefer that this would be enabled through config, rather than being the default? I find warnings about "unused parameters" in a empty method just add noise. |
Well, empty or not, they are unused and sometimes this might be accidental instead of intended - e.g. you got distracted and forgot to write the body of the method. So, yes - I'm fine with supporting this, but it should be configurable. Frankly, I think this is shortcoming of Ruby's design - probably it would have been better if abstract methods could be denoted by some manner. As for empty blocks - it seems to me that an empty block usually doesn't make much sense, right? |
Very well. I can write up a PR. Any idea what the config parameter for |
|
You got it. |
Meaning, "OK, that is fine, you will have it very soon". |
10x :-) |
When defining the interface with an abstract class, you often define methods with args but with an empty body, eg:
The doco describes what the argument is for. If the body is empty, assume it is an abstract method and don't lint on this arg.
The text was updated successfully, but these errors were encountered: