Closed foobear closed 5 months ago
Reverted disabling Style/MinMaxComparison
, it's now explicitly enabled.
Rubocop 1.60.0 has been released on Monday; I'll look into upgrading to 1.60.0 now.
Upgraded to 1.16.0, fixed some quirks in previous commits and prepared changelog.
Will merge and release as version 12.0.0.
Upgrade to support Ruby 3.3 and Rails 7.1.
Newly introduced cops
The upgrade introduces several new cops.
All of them were set to
Enabled: pending
in the default Rubocop configuration. Since we setNewCops: enable
this means all pending cops are enabled, i.e. the same as if we'd explicitly set them toEnabled: true
. We do not want to setEnabled: true
for all of them to avoid merge conflicts when upgrading later.I reviewed all new cops and disabled those which I believe do not provide enough benefit and/or do not match our preferred code styles:
concat
array(s) literals onto another array instead ofpush
ing individual elements. The potential performance difference (virtually always insignificant, since this is about array literals) is IMO not worth enforcingpush
in such cases.min
/max
, e.g. for readability. IMO not worth the noise the cop produces.~UseAnonymousForwarding: false
has been set since I believe enforcing*
and**
does neither match our existing code style nor does it improve code readability (rather the contrary).Warning from Style/ArgumentsForwarding cop
Annoyingly, in a Ruby 3.3 application, Rubocop prints a warning:
I am not sure how to resolve that properly. The parameter is also included in the default configuration, so I assume that is just how Rubocop behaves when it's set from another file. When removing it from our
default.yml
, Rubocop will not print the warning, but I don't know if its defaultAllowOnlyRestArgument: true
still applies. Maybe we don't need to care. Instead of removing that line, we could comment it out and leave a comment about why. Would help with future upgrades.Jan 3 update: I went ahead with commenting out the
AllowOnlyRestArgument
option and left a comment explaining why.What about rubocop-rspec?
I did not upgrade rubocop-rspec as there seem to be some configuration changes between rubocop-rspec and rubocop-capybara now. Did not investigate further.