-
-
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/UselessAccessModifier doesn't respect active support's concerning since 0.40.0 #3136
Comments
We're having this same problem with a vanilla ActiveSupport::Concern. e.g.: module Foo
extend ActiveSupport::Concern
class_methods do
private
...
end
private
def bar
...
end
end
It appears the new implementation is unable to see that the first `private` only applies inside the block. |
I think this has already been fixed in |
@savef It seems that fix was only for blocks given to |
Ah! Sorry. I only tested it on my own false positive (which was a |
Thanks for double checking that. I'm happy to try and make a fix here, although maybe I should loop in @owst and see if he's aware and already doing so. |
I wasn't aware of this, and I'm not already looking so feel free to go ahead @maxjacobson! I would guess that adding a new matcher for However, I'm not sure if we should care that this would be ActiveSupport-specific code in a non-Rails cop, hopefully not! |
Fixed in #3186 |
Hello again after a while!
I'm upgrading a Rails app from RuboCop v0.39.0 to v0.40.0 and noticed some new Lint/UselessAccessModifier offenses appeared in code which looks like this:
In this case, RuboCop thinks the second
private
isn't doing anything, but it actually does make the subsequent methods in the concerning block private.The text was updated successfully, but these errors were encountered: