-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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.2.0 and 2.2.1 to use Psych 3.1 #6766
Conversation
Thanks! |
I think so too :-) |
Installing RuboCop 0.65.0 has a problem on Windows by using Psych 3.1. |
@@ -38,6 +38,7 @@ Gem::Specification.new do |s| | |||
s.add_runtime_dependency('parallel', '~> 1.10') | |||
s.add_runtime_dependency('parser', '>= 2.5', '!= 2.5.1.1') | |||
s.add_runtime_dependency('powerpack', '~> 0.1') | |||
s.add_runtime_dependency('psych', '>= 3.1.0') |
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.
@@ -9,7 +9,7 @@ Gem::Specification.new do |s| | |||
s.name = 'rubocop' | |||
s.version = RuboCop::Version::STRING | |||
s.platform = Gem::Platform::RUBY | |||
s.required_ruby_version = '>= 2.2.0' | |||
s.required_ruby_version = '>= 2.2.2' |
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 would add to @Drenmi's comment by saying that if you are going to require psych 3.1.0, you should probably require ruby 2.6.0 or greater as that seems to be when ruby core made the switch to psych 3.1.0.
Note that psych is used by Ruby core, which creates dependency issues that cannot be resolved by Bundler.
The version requirements in this PR do have an impact, but it is complicated. See my comment in #6781. |
### Summary RuboCop 0.66.0 has been released. https://github.com/rubocop-hq/rubocop/releases/tag/v0.66.0 And rubocop-0-66 channel is available in Code Climate. https://github.com/codeclimate/codeclimate/releases/tag/v0.84.0 RuboCop 0.66.0 fixed the false negative to indentation for modifier. And this PR applied the auto-correction fixed by it. rubocop/rubocop#6792 In addtion, this PR is also updating the following 4 gems that RuboCop depends on. - Update Psych gem ... rubocop/rubocop#6766 - Update Parser gem to 2.6.2.0 that supports Ruby 2.5.5 and 2.6.2 ... https://github.com/whitequark/parser/blob/v2.6.2.0/CHANGELOG.md#changelog - Remove powerpack gem ... rubocop/rubocop#6806 - Update unicode-display_width gem ... rubocop/rubocop#6813
Follow up rubocop#10632 (comment). Reverts part of rubocop#6766, rubocop#7026, and rubocop#7030. Only the Ruby version (2.2) to runtime should have been dropped, not code analysis. This PR makes Ruby 2.2 code analysis with `TargetRubyVersion: 2.2`. It aims to solve essentially the same problem as rubocop#10626, rubocop#10632, and rubocop#10640. Previously, there was the following default enforced style `when_needed` for `Style/FrozenStringLiteralComment` cop. ```ruby # @example EnforcedStyle: when_needed (default) # # The `when_needed` style will add the frozen string literal # # to files only when the `TargetRubyVersion` is set to 2.3+. # # bad # module Foo # # ... # end # # # good # # frozen_string_literal: true # # module Foo # # ... # end ``` This PR does not restore that option, but sets the `minimum_target_ruby_version 2.3` to make `always (default)` apply by default. It is a simple solution that does not handle frozen literal magic comment added in Ruby 2.3 when `TargetRubyVersion` is Ruby 2.2 or lower.
see #6733 (comment)
This pull request drops supporting Ruby 2.2.0 and 2.2.1 to use Psych 3.1.
Parameter style of
YAML.load
has been changed since Psych 3.1. Psych 3.1 still supports the old parameter style, but it displays a warning. So we need to change the behaviour between Psych 3.1 and others to avoid the warning. We can delete the branch by dropping old versions of Psych.And Psych 3.1 also has a location feature. I'd like to use the feature in #6733.
Note: I'd like to drop Ruby 2.2 also. Personally, I think we can drop it after Ruby 2.3 EOL, it is March 2019.
I'm looking forward to using Safe Navigation Operator in RuboCop! 😉
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).and description in grammatically correct, complete sentences.
bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.