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
Follow-up clean-up of Ruby < 2.6 #10805
Conversation
FYI this will partially revert a series of older ruby support restoration PRs starting at #10626 so we probably don’t want to do this 😅(specifically the removal of TargetRubyVersion) |
@@ -159,7 +159,7 @@ def to_supported_styles(enforced_style) | |||
private | |||
|
|||
def compatible_external_encoding_for?(src) | |||
src = src.dup if RUBY_VERSION < '2.3' || RUBY_ENGINE == 'jruby' | |||
src = src.dup if RUBY_ENGINE == 'jruby' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm uncertain if this is still needed on JRuby > 9.2.
context 'with `else` without `rescue`', :ruby25 do | ||
it 'registers an offense' do | ||
expect_offense(<<~RUBY) | ||
begin | ||
do_something | ||
else | ||
^^^^ `else` without `rescue` is useless. | ||
handle_unknown_errors | ||
end | ||
RUBY | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails on Ruby 2.6+, and we don't run specs on CI for them.
Is this spec still useful? Is it still possible to run RuboCop specs locally on Ruby 2.5?
Ruby 2.5 and below were dropped in runtime versions, not analysis versions. I'm going to close this PR because these codes need to be kept as analysis versions. Thank you. |
I'd argue with that. My two points are:
Still, I might be wrong with those points, or might be missing something else, so I'll be happy to adjust/close the PR. |
This complements #10577, considering #10625 an #10697.
As we don't run specs on CI for Ruby < 2.5, those specs that would only run on those Ruby versions are now useless.
Spec changes are better viewed without whitespace.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.