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

Remove useless TARGET_RUBY_VERSION env var #281

Merged

Conversation

koic
Copy link
Member

@koic koic commented Feb 27, 2024

This PR removes useless TARGET_RUBY_VERSION env var and uses PARSER_ENGINE env var instead.

In fact, the ruby_version in shared_context is replaced with the value required by PARSER_ENGINE:

RSpec.shared_context 'ruby 2.3', :ruby23 do
# Prism supports parsing Ruby 3.3+.
let(:ruby_version) { ENV['PARSER_ENGINE'] == 'parser_prism' ? 3.3 : 2.3 }
end
RSpec.shared_context 'ruby 2.4', :ruby24 do
# Prism supports parsing Ruby 3.3+.
let(:ruby_version) { ENV['PARSER_ENGINE'] == 'parser_prism' ? 3.3 : 2.4 }
end
RSpec.shared_context 'ruby 2.5', :ruby25 do
# Prism supports parsing Ruby 3.3+.
let(:ruby_version) { ENV['PARSER_ENGINE'] == 'parser_prism' ? 3.3 : 2.5 }
end
RSpec.shared_context 'ruby 2.6', :ruby26 do
# Prism supports parsing Ruby 3.3+.
let(:ruby_version) { ENV['PARSER_ENGINE'] == 'parser_prism' ? 3.3 : 2.6 }
end
RSpec.shared_context 'ruby 2.7', :ruby27 do
# Prism supports parsing Ruby 3.3+.
let(:ruby_version) { ENV['PARSER_ENGINE'] == 'parser_prism' ? 3.3 : 2.7 }
end
RSpec.shared_context 'ruby 3.0', :ruby30 do
# Prism supports parsing Ruby 3.3+.
let(:ruby_version) { ENV['PARSER_ENGINE'] == 'parser_prism' ? 3.3 : 3.0 }
end
RSpec.shared_context 'ruby 3.1', :ruby31 do
# Prism supports parsing Ruby 3.3+.
let(:ruby_version) { ENV['PARSER_ENGINE'] == 'parser_prism' ? 3.3 : 3.1 }
end
RSpec.shared_context 'ruby 3.2', :ruby32 do
# Prism supports parsing Ruby 3.3+.
let(:ruby_version) { ENV['PARSER_ENGINE'] == 'parser_prism' ? 3.3 : 3.2 }
end

@koic koic force-pushed the remove_unused_target_ruby_version_envvar branch from bd1a44a to 3f959d8 Compare February 27, 2024 15:40
This PR removes useless `TARGET_RUBY_VERSION` env var
and uses `PARSER_ENGINE` env var instead.

In fact, the `ruby_version` in `shared_context` is replaced with
the value required by `PARSER_ENGINE`:
https://github.com/rubocop/rubocop-ast/blob/49b135be4a4edce97955a1e987d50a295f72a907/spec/spec_helper.rb#L22-L60
@koic koic force-pushed the remove_unused_target_ruby_version_envvar branch from 3f959d8 to 915ccdf Compare February 27, 2024 15:42
@bbatsov bbatsov merged commit 91a4226 into rubocop:master Feb 27, 2024
19 of 20 checks passed
@koic koic deleted the remove_unused_target_ruby_version_envvar branch February 27, 2024 16:56
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