This Pull Request has been created because we are running a very old version of rubocop. In particular, this is a problem when using the ruby lsp vscode extension (that is now recommended by the deprecated ruby extension), because it requires rubocop >= 1.4 if I remember correctly.
Detail
This Pull Request:
Updates rubocop version, as well as add rails and performance plugins that we use in other projects
Updates rules to be compatible with this version's syntax
In particular, I disabled RSpec/InstanceVariable, because a lot of our tests use instance variables
Runs bundle exec rubocop -a to fix safe autofixable problems in the whole project
Also, had to update webpacker because of a bug in the ruby 3.1 test suite. The update in rubocop removed the psych 3 requirement, which allowed psych 4 to be installed, as it is included since ruby 3.1, and this bug started appearing, which is solved in newer webpacker versions.
Additional information
Nothing else
Checklist
Before submitting the PR make sure the following are checked:
[x] This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
[x] Commit message has a concise description of what changed and why.
[x] Tests are added or updated if you fix a bug or add a feature.
[x] Documentation has been added or updated if you add a feature or modify an existing one.
[x] CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature (under the "Unreleased" heading if this is not a version change).
[x] My changes don't introduce any linter rule violations.
Motivation / Background
This Pull Request has been created because we are running a very old version of rubocop. In particular, this is a problem when using the ruby lsp vscode extension (that is now recommended by the deprecated ruby extension), because it requires
rubocop >= 1.4
if I remember correctly.Detail
This Pull Request:
RSpec/InstanceVariable
, because a lot of our tests use instance variablesbundle exec rubocop -a
to fix safe autofixable problems in the whole projectAlso, had to update webpacker because of a bug in the ruby 3.1 test suite. The update in rubocop removed the psych 3 requirement, which allowed psych 4 to be installed, as it is included since ruby 3.1, and this bug started appearing, which is solved in newer webpacker versions.
Additional information
Nothing else
Checklist
Before submitting the PR make sure the following are checked: