Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubocop/rubocop
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.66.0
Choose a base ref
...
head repository: rubocop/rubocop
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.66.1
Choose a head ref
  • 15 commits
  • 25 files changed
  • 4 contributors

Commits on Aug 31, 2024

  1. Reset the docs version

    bbatsov committed Aug 31, 2024
    Configuration menu
    Copy the full SHA
    e0de443 View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2024

  1. Configuration menu
    Copy the full SHA
    435bed6 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #13177 from vlad-pisanov/vp_empty_else_1

    Fix crash in `Style/EmptyElse` when `AllowComments: true` and the else clause is missing
    koic authored Sep 1, 2024
    Configuration menu
    Copy the full SHA
    7bb9708 View commit details
    Browse the repository at this point in the history
  3. Fix false positive for Style/EmptyLiteral with Hash.new([])

    The first parameter for Hash.new is the default value:
    
    ```rb
    Hash.new([])[:foo]
    # => []
    ```
    
    Side note: this usage is most likely a programming error. You want the block form
    where different keys _don't_ share the same underlying array.
    Earlopain committed Sep 1, 2024
    Configuration menu
    Copy the full SHA
    60d3cd6 View commit details
    Browse the repository at this point in the history
  4. Merge pull request #13178 from Earlopain/style-empty-literal-hash-def…

    …ault-value
    
    Fix false positive for `Style/EmptyLiteral` with `Hash.new([])`
    koic authored Sep 1, 2024
    Configuration menu
    Copy the full SHA
    4bb7cba View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    fd4f4d7 View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2024

  1. Merge pull request #13179 from Earlopain/node-matcher-directiry-error

    Fix an error for `InternalAffairs/NodeMatcherDirective` when no second argument
    koic authored Sep 2, 2024
    Configuration menu
    Copy the full SHA
    9a38b11 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3277118 View commit details
    Browse the repository at this point in the history

Commits on Sep 3, 2024

  1. Fix false negatives in Style/MapIntoArray autocorrection when using…

    … `ensure`, `def`, `defs` and `for`
    vlad-pisanov committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    d18b3c9 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #13185 from vlad-pisanov/vp_map_into_array_2

    Fix false negatives in `Style/MapIntoArray` autocorrection
    koic authored Sep 3, 2024
    Configuration menu
    Copy the full SHA
    5e65a39 View commit details
    Browse the repository at this point in the history
  3. Use rubocop-ast SimpleForwardable

    Introduced in rubocop/rubocop-ast#312
    Also see #13175
    
    I performance tested this change and found no significant difference,
    which makes sense since it's basically the same thing
    Earlopain authored and bbatsov committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    5f3481f View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2024

  1. Don't parse YAML twice

    Once for the duplication check, and once again to convert it to a ruby hash
    
    We can instead use the yaml ast from the duplication check and convert
    that into a hash directly.
    
    ```
    # Rubocop
    # Base:
    $ hyperfine -w 5 -r 20 "bundle exec rubocop Rakefile"
    Benchmark 1: bundle exec rubocop Rakefile
      Time (mean ± σ):      1.041 s ±  0.014 s    [User: 0.898 s, System: 0.140 s]
      Range (min … max):    1.013 s …  1.061 s    20 runs
    
    # Patch:
    $ hyperfine -w 5 -r 20 "bundle exec rubocop Rakefile"
    Benchmark 1: bundle exec rubocop Rakefile
      Time (mean ± σ):      1.013 s ±  0.008 s    [User: 0.865 s, System: 0.146 s]
      Range (min … max):    0.998 s …  1.027 s    20 runs
    ```
    
    ~2.7%  Faster
    
    ```
    # Gitlab
    # Base:
    $ hyperfine -w 5 -r 20 "bundle exec rubocop Rakefile"
    Benchmark 1: bundle exec rubocop Rakefile
      Time (mean ± σ):      3.485 s ±  0.027 s    [User: 2.565 s, System: 0.909 s]
      Range (min … max):    3.445 s …  3.529 s    20 runs
    
    # Applied:
    $ hyperfine -w 5 -r 20 "bundle exec rubocop Rakefile"
    Benchmark 1: bundle exec rubocop Rakefile
      Time (mean ± σ):      3.401 s ±  0.029 s    [User: 2.483 s, System: 0.906 s]
      Range (min … max):    3.356 s …  3.466 s    20 runs
    ```
    
    ~2.5% faster. I expected more since they have so many config files but hey, still something.
    Earlopain authored and bbatsov committed Sep 4, 2024
    Configuration menu
    Copy the full SHA
    c2ae362 View commit details
    Browse the repository at this point in the history
  2. Fix an error for Style/IfWithSemicolon

    This PR fixes the following error for `Style/IfWithSemicolon`
    when when using nested single-line if/;/end in block of if/else branches.
    
    ```console
    $ cat /tmpp/example.rb
    if foo?;bar;else baz do if qux;else quux;end;end;end
    
    $ bundle exec rubocop --only Style/IfWithSemicolon /tmp/example.rb -a -d
    (snip)
    
    An error occurred while Style/IfWithSemicolon cop was inspecting /tmp/example.rb:1:24.
    Parser::Source::TreeRewriter detected clobbering
    /Users/koic/.rbenv/versions/3.4-dev/lib/ruby/gems/3.4.0+0/gems/parser-3.3.4.2/lib/parser/source/tree_rewriter.rb:427
    :in 'Parser::Source::TreeRewriter#trigger_policy'
    ```
    koic authored and bbatsov committed Sep 4, 2024
    Configuration menu
    Copy the full SHA
    08bed81 View commit details
    Browse the repository at this point in the history
  3. Update Changelog

    bbatsov committed Sep 4, 2024
    Configuration menu
    Copy the full SHA
    2900c91 View commit details
    Browse the repository at this point in the history
  4. Cut 1.66.1

    bbatsov committed Sep 4, 2024
    Configuration menu
    Copy the full SHA
    ba8e7be View commit details
    Browse the repository at this point in the history
Loading