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
Add OptionalBooleanParameter AllowedMethods configuration #8489
Comments
Good point. |
Hmm, I don't know. |
Can we start by fixing this for |
🙇 @natematykiewicz Yeah, I'd like that too. I've still not found another more pressing example other than |
…OptionalBooleanParameter cop.
Describe the solution you'd like
When using
Style/OptionalBooleanParameter
, it would be nice to define a set of allowed methods as used via Style/NestedParenthesizedCalls, for example. For instance, when metaprograming, it's common to want to useObject#respond_to_missing?
:The use of
include_private = false
, in this case, is what causes this cop to flag the code as a violation. I agree, it is. ...but this is a standard library method which is out of my control as an implementer.Describe alternatives you've considered
I've been able temporarily work around this issue by using an exclude:
This is not ideal as I'd rather not exclude the entire file but ignore a bad practice within the standard library that is out of my control instead.
The text was updated successfully, but these errors were encountered: