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

Drop Ruby 2.5 support #10577

Merged
merged 2 commits into from Apr 25, 2022
Merged

Drop Ruby 2.5 support #10577

merged 2 commits into from Apr 25, 2022

Conversation

koic
Copy link
Member

@koic koic commented Apr 24, 2022

This includes the following changes:

Require JRuby 9.3 or higher

CRuby 2.5 compatible JRuby 9.2 will be dropped and CRuby 2.6 compatible JRuby 9.3 or higher is required.

Retire Lint/UselessElse cop

Ruby 2.6 does not support begin ... else syntax. So Lint/UselessElse can't work because it causes a parsing error.

NOTE: Some bugs found in RuboCop 1.28.1 have been fixed in the master branch. If the next version is a bug fix (i.e. 1.28.2), this PR would wait to be merged until the next minor release.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

This includes the following changes:

This PR drops Ruby 2.5 support.
And CRuby 2.5 compatible JRuby 9.2 will be dropped and CRuby 2.6 compatible
JRuby 9.3 or higher is required.
Ruby 2.6 does not support `begin` ... `else` syntax.
So `Lint/UselessElse` can't work because it causes a parsing error.
@bbatsov bbatsov merged commit 2155629 into rubocop:master Apr 25, 2022
@bbatsov
Copy link
Collaborator

bbatsov commented Apr 25, 2022

Excellent PR! It shows you the nice progress that every Ruby release has made, given the many small improvements that are now possible in RuboCop's code. 🚀

I was wondering for a bit i we shouldn't make Lint/UselessElse a no-op to reduce the likelihood of something breaking after this update, but I doubt anyone was disabling it, so the deletion should likely be fine.

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 25, 2022

(and I did cut 1.28.2 just before merging this PR)

@koic koic deleted the drop_ruby_25 branch April 25, 2022 07:20
koic added a commit to koic/rubocop-rails that referenced this pull request Apr 25, 2022
koic added a commit to koic/rubocop-performance that referenced this pull request Apr 25, 2022
koic added a commit to koic/rubocop-minitest that referenced this pull request Apr 25, 2022
ydah added a commit to ydah/rubocop-rspec that referenced this pull request Apr 26, 2022
ydah added a commit to ydah/rubocop-rspec that referenced this pull request Apr 26, 2022
ydah added a commit to ydah/rubocop-rspec that referenced this pull request Apr 26, 2022
koic added a commit to koic/rubocop-ast that referenced this pull request Apr 26, 2022
marcandre pushed a commit to rubocop/rubocop-ast that referenced this pull request Apr 26, 2022
ydah added a commit to ydah/rubocop-rspec that referenced this pull request Apr 27, 2022
pboling added a commit to rubocop-lts/rubocop-ruby2_5 that referenced this pull request May 2, 2022
- rubocop/rubocop#10577

Signed-off-by: Peter Boling <peter.boling@gmail.com>
koic added a commit to koic/rubocop that referenced this pull request May 12, 2022
…2.5`

Fixes rubocop#10625 and reverts part of rubocop#10577.

Only the Ruby version (2.5) to runtime should have been dropped, not code analysis.
This PR the specification to `TargetRubyVersion: 2.5` So, this keeps it compatible
with `TargetRubyVersion` up to 1.28.2.
bbatsov pushed a commit that referenced this pull request May 12, 2022
Fixes #10625 and reverts part of #10577.

Only the Ruby version (2.5) to runtime should have been dropped, not code analysis.
This PR the specification to `TargetRubyVersion: 2.5` So, this keeps it compatible
with `TargetRubyVersion` up to 1.28.2.
@deivid-rodriguez
Copy link
Contributor

Hi @koic, thanks for all the work here. Should the Lint/UselessElseWithoutRescue should also be restored, given that TargetRubyVersion: 2.5 is back?

koic added a commit to koic/rubocop that referenced this pull request Jun 7, 2022
This reverts commit 6d0b336 and tweaked.

Follow up rubocop#10577 (comment).

RuboCop 1.29.1 and higher can analyze Ruby 2.5 code again, so it can restore the cop.
@koic
Copy link
Member Author

koic commented Jun 7, 2022

@deivid-rodriguez Yup, I think so too! I've opened #10697 to restore the Lint/UselessElseWithoutRescue cop. Thank you!

bbatsov pushed a commit that referenced this pull request Jun 7, 2022
This reverts commit 6d0b336 and tweaked.

Follow up #10577 (comment).

RuboCop 1.29.1 and higher can analyze Ruby 2.5 code again, so it can restore the cop.
@pirj pirj mentioned this pull request Jul 11, 2022
5 tasks
koic added a commit to koic/rubocop-packaging that referenced this pull request Aug 5, 2022
Follow rubocop/rubocop#10577.

This PR drops Ruby 2.5 runtime support and fixes the following build error.
https://github.com/utkarsh2102/rubocop-packaging/runs/7688082957
koic added a commit to koic/rubocop-faker that referenced this pull request Aug 17, 2022
Follow up rubocop/rubocop#10577.

This commit drops Ruby 2.5 runtime support.
And CRuby 2.5 compatible JRuby 9.2 will be dropped and CRuby 2.6 compatible
JRuby 9.3 or higher is required.
koic added a commit to koic/rubocop-faker that referenced this pull request Aug 17, 2022
Follow up rubocop/rubocop#10577.

This commit drops Ruby 2.5 runtime support.
And CRuby 2.5 compatible JRuby 9.2 will be dropped and CRuby 2.6 compatible
JRuby 9.3 or higher is required.
koic added a commit to koic/rubocop-faker that referenced this pull request Aug 17, 2022
Follow up rubocop/rubocop#10577.

This commit drops Ruby 2.5 runtime support.
And CRuby 2.5 compatible JRuby 9.2 will be dropped and CRuby 2.6 compatible
JRuby 9.3 or higher is required.
renawatson68 added a commit to renawatson68/performance-develop-rubyonrails that referenced this pull request Sep 23, 2022
richardstewart0213 added a commit to richardstewart0213/performance-build-Performance-optimization-analysis- that referenced this pull request Nov 4, 2022
pirj pushed a commit to rubocop/rubocop-capybara that referenced this pull request Dec 29, 2022
ydah added a commit to rubocop/rubocop-factory_bot that referenced this pull request Apr 13, 2023
MarttiCheng added a commit to MarttiCheng/Rubocop-Performance that referenced this pull request Sep 28, 2023
SerhiiMisiura added a commit to SerhiiMisiura/Rubocop-Performance that referenced this pull request Oct 5, 2023
ydah added a commit to rubocop/rubocop-rspec_rails that referenced this pull request Mar 27, 2024
ydah added a commit to rubocop/rubocop-rspec_rails that referenced this pull request Mar 27, 2024
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.

None yet

3 participants