Skip to content
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

Upgrade RuboCop to v1.30 #1268

Merged
merged 7 commits into from
Jun 6, 2022
Merged

Conversation

mishina2228
Copy link
Contributor

RuboCop v1.30.0 can now parse Ruby 2.0 code.
This PR upgrades RuboCop to v1.30 and also fixes and suppresses some cops.
It was hard to fix all cops, so I fixed only the simple ones.

This PR supersedes #1256.

Copy link
Collaborator

@sodabrew sodabrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for doing this! The only specific change I'd like is removing the extra psych gem that was pinned lower for older versions of RuboCop.

The other comment about older versions of Rake can be dealt with in a Ruby 2.x or higher pass. There may be some other old syntax or old C extension methods that can be cleaned up as well.

Gemfile Outdated Show resolved Hide resolved
else
'< 13'
end
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.2")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the next release could drop Ruby < 2.2

Copy link
Contributor Author

@mishina2228 mishina2228 Jun 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to omit if-else condition, but rake 13.x supports only Ruby 2.2+.
So can we drop Ruby 2.1 from the CI matrix?

ruby:
- '3.1'
- '3.0'
- '2.7'
- '2.6'
- '2.5'
- '2.4'
- '2.3'
- '2.2'
- '2.1'

and also CentOS 7 with Ruby 2.0.0?

# CentOS 7 system Ruby is the fixed version 2.0.0.
- {distro: centos, image: 'centos:7', name_extra: 'ruby 2.0.0'}

RuboCop v1.30.1 fixed a false positive for Style/SafeNavigation
@sodabrew sodabrew merged commit 9d49828 into brianmario:master Jun 6, 2022
@mishina2228 mishina2228 deleted the upgrade-rubocop branch June 7, 2022 09:30
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants