-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Enable pending cops up to RuboCop v1.63 #1879
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
cc @pirj I would like your opinion on this PR too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the same preferences for the block syntax.
For the pin the rubocop version vs keep NewCops disabled, I’d rather keep it as is, and run our the code in specs with the latest released (or latest cached by bundler?) RuboCop version rather than inspected our code with it.
The necessity to make such a decision comes from the fact that RuboCop is both the base for extensions like ours, and a set of cops. I’m not a huge propeonent of this, and I hoped this will follow the trend if rubocop-ast, but it is what it is.
Thank you!
I am not sure I understand this part of your response. Can you please elaborate a bit? I think the three conflicting goals here are:
|
a417b30
to
e12ed7b
Compare
There is one thing we might be missing - it’s to test our code against our minimum specified rubocop version. |
Please correct me, but it feels that 1 is not easy together with 3.
I don’t have a good solution to this, and think it’s inevitable. If we don’t enable new cops too often -it’s not a big burden. |
Yeah, you’re probably right. We should not enable new cops very often. And we should start running CI with the minimum allowed RuboCop version. |
See #1882. |
Also fixed a couple of offenses.
e12ed7b
to
dcd50c6
Compare
Rebased. Are you ok with merging @pirj ? |
Yes, please proceed with the merge. All perfect. Thank you! |
I enabled the pending cops up until RuboCop v1.63, and fixed most offenses. We want to keep the
NewCops: disable
settings, so PRs are not blocked by newly added cops forcing changes to the entire code base. But we should update once in a while, even if it means everyone needs tobundle update
. Or we could addrubocop
to Gemfile with a version restriction?I am fixing
Performance/MethodObjectAsBlock
in two commits, which should be squashed before merging:Performance/MethodObjectAsBlock
using numbered parameters:I really dislike the
foo(&method(:bar))
style, and in my opinionPerformance/MethodObjectAsBlock
might as well have been aStyle
cop. I tried fixing the offenses using numbered parameters (_1
) but I‘m not a fan of that syntax either, to be honest.Performance/MethodObjectAsBlock
using block arguments:I think the plain old block arguments are much easier to read than numbered parameters – except maybe in a few cases. E.g. is
{ |n| let?(n) }
really better to read than{ let?(_1) }
?The
Lint/ToEnumArguments
offense listed in the todo file is due to a bug: rubocop/rubocop#12885Before submitting the PR make sure the following are checked:
master
(if not - rebase it).Added tests.Updated documentation.Added an entry to theCHANGELOG.md
if the new code introduces user-observable changes.bundle exec rake
) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).