-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Fix #12309] Add new Style/SuperArguments
cop
#12427
[Fix #12309] Add new Style/SuperArguments
cop
#12427
Conversation
There might be users who intentionally write explicit arguments. So, I wonder if the cop name "Redundant" is suitable. |
It's likely that cop name such as |
@Earlopain ping :-) |
35b91fa
to
c2e596b
Compare
Oh, I forgot I even did this. I renamed the cop to the suggestion from koic and disabled it by default. I don't fell strongly about this anymore to discuss about this in the styleguide, so if disabled by default is not good then feel free to close this. |
I think the cop is useful, and I even thought we already had something like it. As far as the names go - I'm not sure I like @rubocop/rubocop-core Any opinions on this would be welcome! |
I don't think there's much to discuss about such a guideline as I thought that most people omit the redundant args, so you can safely file a PR in the style guide. I'm also not sure this should be disabled by default - probably we can leave it to the users to decide if they'd fine it useful or not. |
c2e596b
to
1cacf7a
Compare
|
1cacf7a
to
f7d93e5
Compare
Alright, I've openend rubocop/ruby-style-guide#941, set it back to pending and renamed to I stumbled upon an interesting interaction I wasn't really aware of with blocks, see the styleguide PR for what I'm talking about. I can't think of any changes this cop would need because of this. |
f7d93e5
to
4fabb89
Compare
Thanks for your review, I appreciate it. I should have addresses all your points |
4fabb89
to
f99645f
Compare
Thanks! |
Style/RedundantSuperArguments
copStyle/SuperArguments
cop
#12309 Implements the following:
There are 57 offenses of this kind in Rails master.
Looks like I picked quite the doozy for my first cop. I managed but I'm open to feedback on how to write better code here.
I tried to think of all the constellations you can use
super
in and handling those appropriately in the cop but I'm not certain if I got it all. Let me know if there are other edge-cases that need to be considered, like callingsuper
insidedefine_singleton_method
.The cop could be more intelligent with keyword arguments when they appear in different orders like in the following example but I'll leave that be for now since the cop seems quite complex already. Something to improve upon in the future.
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.