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 support to Ruby 3.1 #53041

Merged
merged 1 commit into from
Sep 26, 2024
Merged

Drop support to Ruby 3.1 #53041

merged 1 commit into from
Sep 26, 2024

Conversation

rafaelfranca
Copy link
Member

Rails 8 will require Ruby 3.2.0 or newer.

Rails 8 will require Ruby 3.2.0 or newer.
@rafaelfranca rafaelfranca merged commit e93fb95 into main Sep 26, 2024
9 checks passed
@rafaelfranca rafaelfranca deleted the rm-drop-3.1 branch September 26, 2024 13:36
yahonda added a commit to yahonda/rails that referenced this pull request Sep 27, 2024
Rails main branch requires Ruby 3.2.0, we can also update the RuboCop TargetRubyVersion to 3.2.
In Ruby 3.2, the Set class was made built-in, so it no longer requires require 'set',

https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/
> Set is now available as a builtin class without the need for require "set"

then it addresses the following `Lint/RedundantRequireStatement` not to run `require "set"`.

```ruby
$ bundle exec rubocop -A
Inspecting 3324 files
... snip ...

Offenses:

actioncable/lib/action_cable/channel/base.rb:5:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
actioncable/lib/action_cable/connection/identification.rb:5:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
actionmailer/test/base_test.rb:4:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
actionpack/lib/abstract_controller/rendering.rb:8:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
actionpack/lib/action_controller/metal/renderers.rb:5:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
actionpack/lib/action_controller/metal/strong_parameters.rb:13:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
actionview/lib/action_view/helpers/atom_feed_helper.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
actionview/lib/action_view/helpers/tag_helper.rb:7:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
actionview/test/actionpack/abstract/abstract_controller_test.rb:4:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activejob/lib/active_job/serializers.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activerecord/lib/active_record/attribute_methods/primary_key.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activerecord/lib/active_record/fixtures.rb:5:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activerecord/lib/active_record/migration.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activesupport/lib/active_support/delegation.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activesupport/lib/active_support/dependencies.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activesupport/lib/active_support/evented_file_update_checker.rb:6:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activesupport/lib/active_support/notifications/fanout.rb:4:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activesupport/test/core_ext/class_test.rb:6:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activesupport/test/descendants_tracker_test.rb:4:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
railties/lib/rails/application/bootstrap.rb:4:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
railties/lib/rails/application/finisher.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
railties/test/application/configuration_test.rb:6:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
railties/test/application/zeitwerk_integration_test.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
tools/rail_inspector/lib/rail_inspector/visitor/attribute.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^

3324 files inspected, 25 offenses detected, 25 offenses corrected
$
```

Follow up rails#53041
yahonda added a commit to yahonda/rails that referenced this pull request Sep 27, 2024
Rails main branch requires Ruby 3.2.0, we can also update the RuboCop TargetRubyVersion to 3.2.
In Ruby 3.2, the Set class was made built-in, so it no longer requires require 'set'.

https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/
> Set is now available as a builtin class without the need for require "set"

then it addresses the following `Lint/RedundantRequireStatement` not to run `require "set"`.

```ruby
$ bundle exec rubocop -A
Inspecting 3324 files
... snip ...

Offenses:

actioncable/lib/action_cable/channel/base.rb:5:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
actioncable/lib/action_cable/connection/identification.rb:5:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
actionmailer/test/base_test.rb:4:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
actionpack/lib/abstract_controller/rendering.rb:8:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
actionpack/lib/action_controller/metal/renderers.rb:5:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
actionpack/lib/action_controller/metal/strong_parameters.rb:13:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
actionview/lib/action_view/helpers/atom_feed_helper.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
actionview/lib/action_view/helpers/tag_helper.rb:7:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
actionview/test/actionpack/abstract/abstract_controller_test.rb:4:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activejob/lib/active_job/serializers.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activerecord/lib/active_record/attribute_methods/primary_key.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activerecord/lib/active_record/fixtures.rb:5:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activerecord/lib/active_record/migration.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activesupport/lib/active_support/delegation.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activesupport/lib/active_support/dependencies.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activesupport/lib/active_support/evented_file_update_checker.rb:6:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activesupport/lib/active_support/notifications/fanout.rb:4:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activesupport/test/core_ext/class_test.rb:6:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
activesupport/test/descendants_tracker_test.rb:4:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
railties/lib/rails/application/bootstrap.rb:4:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
railties/lib/rails/application/finisher.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
railties/test/application/configuration_test.rb:6:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
railties/test/application/zeitwerk_integration_test.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
tools/rail_inspector/lib/rail_inspector/visitor/attribute.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^

3324 files inspected, 25 offenses detected, 25 offenses corrected
$
```

Follow up rails#53041
yahonda added a commit to yahonda/rails that referenced this pull request Sep 27, 2024
Rails main branch requires Ruby 3.2.0, we can also update the RuboCop TargetRubyVersion to 3.2.
In Ruby 3.2, the Set class was made built-in, so it no longer requires require 'set'.

https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/
> Set is now available as a builtin class without the need for require "set"

then it addresses the following `Lint/RedundantRequireStatement` not to run `require "set"`.
and removes the two extra lines after removing the `require "set"` manually.

```ruby
$ bundle exec rubocop -A
Inspecting 3324 files
... snip ...

Offenses:

actioncable/lib/action_cable/channel/base.rb:5:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
... snip ...
tools/rail_inspector/lib/rail_inspector/visitor/attribute.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^

3324 files inspected, 25 offenses detected, 25 offenses corrected
$
```

Follow up rails#53041
yahonda added a commit to yahonda/rails that referenced this pull request Sep 28, 2024
Rails main branch requires Ruby 3.2.0. This commit removes the TargetRubyVersion setting from .rubocop.yml,
allowing RuboCop to determine the value from the rails.gemspec file.
Since RuboCop 1.3.0, it has supported setting TargetRubyVersion directly from gemspec files.

In Ruby 3.2, the Set class was made built-in, so it no longer requires require 'set'.

https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/
> Set is now available as a builtin class without the need for require "set"

then it addresses the following `Lint/RedundantRequireStatement` not to run `require "set"`.
and removes the two extra lines after removing the `require "set"` manually.

```ruby
$ bundle exec rubocop -A
Inspecting 3324 files
... snip ...

Offenses:

actioncable/lib/action_cable/channel/base.rb:5:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
... snip ...
tools/rail_inspector/lib/rail_inspector/visitor/attribute.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^

3324 files inspected, 25 offenses detected, 25 offenses corrected
$
```

Follow up rails#53041

Refer to
https://github.com/rubocop/rubocop/releases/tag/v1.3.0
rubocop/rubocop#8761
DanielaVelasquez pushed a commit to DanielaVelasquez/rails that referenced this pull request Oct 3, 2024
Rails main branch requires Ruby 3.2.0. This commit removes the TargetRubyVersion setting from .rubocop.yml,
allowing RuboCop to determine the value from the rails.gemspec file.
Since RuboCop 1.3.0, it has supported setting TargetRubyVersion directly from gemspec files.

In Ruby 3.2, the Set class was made built-in, so it no longer requires require 'set'.

https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/
> Set is now available as a builtin class without the need for require "set"

then it addresses the following `Lint/RedundantRequireStatement` not to run `require "set"`.
and removes the two extra lines after removing the `require "set"` manually.

```ruby
$ bundle exec rubocop -A
Inspecting 3324 files
... snip ...

Offenses:

actioncable/lib/action_cable/channel/base.rb:5:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^
... snip ...
tools/rail_inspector/lib/rail_inspector/visitor/attribute.rb:3:1: W: [Corrected] Lint/RedundantRequireStatement: Remove unnecessary require statement.
require "set"
^^^^^^^^^^^^^

3324 files inspected, 25 offenses detected, 25 offenses corrected
$
```

Follow up rails#53041

Refer to
https://github.com/rubocop/rubocop/releases/tag/v1.3.0
rubocop/rubocop#8761
yahonda added a commit to yahonda/rails that referenced this pull request Oct 4, 2024
This commit removes conditions to see if ErrorHighligh 0.4.0 or higher version
is available since ErrorHighlight 0.5.1+ is always available since Ruby 3.2
that is required by the Rails current main branch.

- Ruby 3.2.0 Released
https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/

ErrorHighlight.spot(ex, backtrace_location: self)
> The following default gems are updated.
> error_highlight 0.5.1

Related to rails#48299 rails#53041
yahonda added a commit to yahonda/rails that referenced this pull request Oct 4, 2024
This commit removes conditions to see if ErrorHighligh 0.4.0 or higher version
is available since ErrorHighlight 0.5.1+ is always available since Ruby 3.2
that is required by the Rails current main branch.

- Ruby 3.2.0 Released
https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/

ErrorHighlight.spot(ex, backtrace_location: self)
> The following default gems are updated.
> error_highlight 0.5.1

Related to rails#48299 rails#53041
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant