stripe-ruby icon indicating copy to clipboard operation
stripe-ruby copied to clipboard

Bump version of rubocop

Open TomMD opened this issue 3 years ago • 4 comments

Version 2.3 (in rubocop.yaml) is no longer supported. 2.4 seems to operate fine, so here's a PR.

TomMD avatar Nov 07 '20 00:11 TomMD

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 07 '20 00:11 CLAassistant

Thanks! It looks like we have a couple failures as per build:

lib/stripe/stripe_client.rb:437:11: C: Style/HashTransformValues: Prefer transform_values over map {...}.to_h.
          flattened_params.map { |k, v| [k, v.is_a?(String) ? v : v.to_s] }.to_h
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/stripe/stripe_object.rb:189:7: C: Style/HashTransformValues: Prefer transform_values over each_with_object.
      @values.each_with_object({}) do |(key, value), acc| ...
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/stripe/stripe_object.rb:560:7: C: Style/HashTransformValues: Prefer transform_values over each_with_object.
      values.each_with_object({}) do |(k, _), update| ...
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
stripe.gemspec:10:29: C: Gemspec/RequiredRubyVersion: required_ruby_version (2.3, declared in stripe.gemspec) and TargetRubyVersion (2.4, which may be specified in .rubocop.yml) should be equal.
  s.required_ruby_version = ">= 2.3.0"
                            ^^^^^^^^^^

Are you willing to take a look at those?

brandur-stripe avatar Nov 09 '20 18:11 brandur-stripe

Yes, can do.

TomMD avatar Nov 09 '20 20:11 TomMD

@TomMD Thanks!

And regarding the build breaking: it's because RuboCop might enforce different lint rules depending on the Ruby version, so I suspect it's just that some new default lints came in with 2.4.

brandur-stripe avatar Nov 09 '20 20:11 brandur-stripe