-
Notifications
You must be signed in to change notification settings - Fork 655
AO3-7013 Update Rubocop to the latest version #5463
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
base: master
Are you sure you want to change the base?
Conversation
|
@sarken @brianjaustin we have a problem with PhraseApp compatibility, there’s a monkeypatch version mismatch so I’m not sure if I should comment and disable it for this ticket, and get a new ticket created to address that, or fix it all in this same ticket? |
|
Going to leave any decisions about Phraseapp up to @Bilka2! |
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.
It looks like the blast radius for updates in the lockfile is pretty large. Could you try resetting it, running bundle update --conservative rubocop (should be enough for all 3 rubocop packages), and committing those changes?
Regarding the optional cops: we'll discuss them and get back to you!
weird, i'm sure i had seen a comment here detailing what cops to set as enabled and which ones should be disabled, did you remove the message? As for the rest, already fixed it + including upgrade of rubocop to latest version instead Also, please don't forget to respond to:
I ended up locking the phraseapp version to one that works, the current version is too open ">=1.0.6", so i set it to '~> 1.4.0' instead. It's worth checking if the monkeypath is still needed if we upgrade the phraseapp version to a newer version instead. There's also something weird. I see in the commit history we are on the Ruby 3.4 version. The .rubocop.yml was targeting 3.1, so i guess the person who changed missed changing that too. In these new changes:
Also not sure why those 3 tests fail, so if you have any idea, let me know. |
Yes, apologies about that; I was a bit over-eager, so I edited out the list until we're fully ready (I think it will mostly stay the same though)
To clarify, we only want the rubocop dependencies upgraded in this PR, not Phrase. This should avoid the issue for now (we are in discussions about the future of Phrase integration, so it's not worth the time investment regarding the monkeypatch). The version shouldn't be updated with the more targeted bundler command I linked above.
I haven't had a chance to dig into this (yet), but I would work on reducing the number of changes to |
I'm going to verify then why it changes so much for me even when using the conservative flag. That's why I had to lock PhraseApp and the other gem. If I see the result is the same I'll leave the changes that are already there until you have time to review the other 3 failing tests. |
|
Please reduce the amount of changes in the Gemfile.lock, it would be wasted effort to investigate failing tests before that is done. Ideally, only rubocop, rubocop-rails, rubocop-rspec and their depedencies should be upgraded. I have also verified that this is doable with the |
marcus8448
left a comment
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.
Here's the list of cops to be enabled/disabled:
| Cop Name | Final Decision | Notes |
|---|---|---|
| Style/NumberedParameters | Enable | EnforcedStyle: Disallow |
| Style/ArgumentsForwarding | Enable | |
| Style/EndlessMethod | Enable | |
| Style/DataInheritance | Enable | |
| Style/OpenStructUse | Disable | |
| Style/TopLevelMethodDefinition | Enable | |
| Security/CompoundHash | Enable | |
| Security/IoMethods | Enable | |
| Style/MapCompactWithConditionalBlock | Enable | |
| Style/RedundantEach | Enable | |
| Style/RedundantFilterChain | Enable | |
| Style/CombinableDefined | Enable | |
| Metrics/CollectionLiteralLength | Disable | |
| Layout/LineContinuationLeadingSpace | Enable | |
| Layout/LineContinuationSpacing | Enable |
Ok please allow me this week and I'll try to fix it, I want to close this ticket myself, the season is delaying everything for me but I'll do it |
Pull Request Checklist
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-7013
Purpose
Upgraded RuboCop:
Testing Instructions
References
The requested file has the cops that, for me, are opinion-dependent. There are more that are auto-enabled, and I didn't add them because those make sense, but let me know if I should add everything to the file. I'll make sure to upload the file into Jira ticket too.
RUBOCOP_TEAM_REVIEW_SPREADSHEET.csv
Credit
warlockmel (she/her)