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

Drop Ruby 2.4 support #9648

Merged
merged 3 commits into from Apr 5, 2021
Merged

Drop Ruby 2.4 support #9648

merged 3 commits into from Apr 5, 2021

Commits on Mar 31, 2021

  1. Drop Ruby 2.4 support

    koic committed Mar 31, 2021
    Copy the full SHA
    f286f21 View commit details
    Browse the repository at this point in the history
  2. Workaround for Style/RedundantBegin when using JRuby 9.2

    Workaround for jruby/jruby#6642.
    
    This commits prevent the following error when using JRuby 9.2.
    
    ```console
    % ruby -v
    jruby 9.2.17.0 (2.5.8) 2021-03-29 84d363da97 Java HotSpot(TM) 64-Bit
    Server VM 25.271-b09 on 1.8.0_271-b09 +jit [darwin-x86_64]
    
    % bundle exec rake documentation_syntax_check
    [warn]: Syntax error in
    `lib/rubocop/cop/lint/shadowed_exception.rb`:(118,18): syntax error,
    unexpected keyword_rescue
    
    [warn]: ParserSyntaxError: syntax error in
    `lib/rubocop/cop/lint/shadowed_exception.rb`:(118,18): syntax error,
    unexpected keyword_rescue
    
    [warn]: Stack trace:
            /Users/koic/.rbenv/versions/jruby-9.2.17.0/lib/ruby/gems/shared/gems/yard-0.9.26/lib/yard/parser/ruby/ruby_parser.rb:601:in
            `on_parse_error'
            org/jruby/ext/ripper/RubyRipper.java:347:in `parse'
            /Users/koic/.rbenv/versions/jruby-9.2.17.0/lib/ruby/gems/shared/gems/yard-0.9.26/lib/yard/parser/ruby/ruby_parser.rb:56:in
            `parse'
            /Users/koic/.rbenv/versions/jruby-9.2.17.0/lib/ruby/gems/shared/gems/yard-0.9.26/lib/yard/parser/ruby/ruby_parser.rb:17:in
            `parse'
            /Users/koic/.rbenv/versions/jruby-9.2.17.0/lib/ruby/gems/shared/gems/yard-0.9.26/lib/yard/parser/source_parser.rb:442:in
            `parse'
            /Users/koic/.rbenv/versions/jruby-9.2.17.0/lib/ruby/gems/shared/gems/yard-0.9.26/lib/yard/parser/source_parser.rb:46:in
            `block in parse'
    
    Files:         569
    Modules:        88 (   13 undocumented)
    Classes:       531 (    2 undocumented)
    Constants:     892 (  879 undocumented)
    Attributes:     31 (    0 undocumented)
    Methods:      1186 ( 1060 undocumented)
     28.37% documented
    rake aborted!
    NoMethodError: undefined method `each' for nil:NilClass
    /Users/koic/src/github.com/rubocop/rubocop/Rakefile:105:in `block in
    /Users/koic/src/github.com/rubocop/rubocop/Rakefile'
    /Users/koic/src/github.com/rubocop/rubocop/lib/rubocop/cop/registry.rb:207:in
    `each'
    /Users/koic/src/github.com/rubocop/rubocop/Rakefile:96:in `block in
    <main>'
    /Users/koic/.rbenv/versions/jruby-9.2.17.0/bin/bundle:23:in `<main>'
    Tasks: TOP => documentation_syntax_check
    (See full trace by running task with --trace)
    ```
    koic committed Mar 31, 2021
    Copy the full SHA
    8c2efd0 View commit details
    Browse the repository at this point in the history
  3. Workaround for Performance/RedundantEqualityComparisonBlock when us…

    …ing JRuby 9.2
    
    This commits prevent the following build error when using JRuby 9.2.
    
    ```console
    % ruby -v
    jruby 9.2.17.0 (2.5.8) 2021-03-29 84d363da97 Java HotSpot(TM) 64-Bit
    Server VM 25.271-b09 on 1.8.0_271-b09 +jit [darwin-x86_64]
    
    % bundle exec rspec ./spec/rubocop/cop/style/parallel_assignment_spec.rb
    (snip)
    
    Run options: include {:focus=>true}
    
    All examples were filtered out; ignoring {:focus=>true}
    
    Randomized with seed 34110
    ...............................................F..F.........F................
    
    Failures:
    
      1) RuboCop::Cop::Style::ParallelAssignment behaves like allowed allows
      assignment of: obj.attr1, ary[0] = ary[0], obj.attr1
         Failure/Error: expect(actual_annotations.to_s).to eq(source)
    
           expected: "obj.attr1, ary[0] = ary[0], obj.attr1"
                got: "obj.attr1, ary[0] = ary[0],
                obj.attr1^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not use
                parallel assignment.\n"
    
           (compared using ==)
    
           Diff:
           @@ -1 +1 @@
           -obj.attr1, ary[0] = ary[0], obj.attr1
           +obj.attr1, ary[0] = ary[0],
           obj.attr1^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not use
           parallel assignment.
    (snip)
    
    Finished in 2.29 seconds (files took 4.04 seconds to load)
    77 examples, 3 failures
    
    Failed examples:
    
    rspec ./spec/rubocop/cop/style/parallel_assignment_spec.rb[1:42:1] #
    RuboCop::Cop::Style::ParallelAssignment behaves like allowed allows
    assignment of: obj.attr1, ary[0] = ary[0], obj.attr1
    rspec ./spec/rubocop/cop/style/parallel_assignment_spec.rb[1:43:1] #
    RuboCop::Cop::Style::ParallelAssignment behaves like allowed allows
    assignment of: ary[0], ary[1], ary[2] = ary[1], ary[2], ary[0]
    rspec ./spec/rubocop/cop/style/parallel_assignment_spec.rb[1:40:1] #
    RuboCop::Cop::Style::ParallelAssignment behaves like allowed allows
    assignment of: a[0], a[1] = a[1], a[0]
    ```
    
    It's supposed to be a JRuby's issue for `array.any?(item)`, it needs to be investigated.
    koic committed Mar 31, 2021
    Copy the full SHA
    f2a1784 View commit details
    Browse the repository at this point in the history