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

Declare supported ruby versions of rbs #548

Merged
merged 1 commit into from Jan 16, 2021
Merged

Conversation

satoryu
Copy link
Contributor

@satoryu satoryu commented Dec 26, 2020

This PR provides a patch to declare ruby versions supported by rbs.

This PR provides a patch to declare ruby versions supported by rbs.
Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

👍

@soutaro soutaro merged commit 30d02c7 into ruby:master Jan 16, 2021
@@ -34,4 +34,5 @@ Gem::Specification.new do |spec|
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.required_ruby_version = ">= 2.6"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm concerned that it is inconsistent with TargetRubyVersion of .rubocop.yml. It's better to be consistent with minimum version of Ruby (2.6? or 2.7?) that RBS supports.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm. What does TargetRubyVersion mean for Rubycw/Rubycw? @pocke

Copy link
Member

Choose a reason for hiding this comment

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

TargetRubyVersion does not affect Rubycw/Rubycw cop. The cop uses RubyVM::AST to detect warnings, so it depends on the runtime Ruby version. If RuboCop runs on Ruby 2.6, the cop checks codes as Ruby 2.6.

But I think it is a good idea to make TargetRubyVersion and required_ruby_version the same.
It is the best practice of RuboCop and it avoids confusion like this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants