Skip to content

Commit

Permalink
Follow "Separate Keyword Arguments from Positional Arguments"
Browse files Browse the repository at this point in the history
Follow ruby/ruby#2395.

RuboCop's CI of Ruby 2.7 matrix is failing. This is due to
a deprecation warning in Ruby 2.7.

```console
  1) RuboCop::CLI when BlockDelimiters has braces_for_chaining style
  corrects SpaceBeforeBlockBraces, SpaceInsideBlockBraces offenses
     Failure/Error: expect($stderr.string).to eq('')

       expected: ""
            got:
            "/usr/local/bundle/gems/parser-2.6.4.0/lib/parser/source/tree_rewriter.rb:284:
            warning: The last
            argu...parser-2.6.4.0/lib/parser/source/tree_rewriter.rb:288:
            warning: for `trigger_policy' defined here\n"
```

https://circleci.com/gh/rubocop-hq/rubocop/67195

This PR suppress the above Ruby 2.7's warning.
  • Loading branch information
koic committed Sep 4, 2019
1 parent 0b96cf7 commit d2c8e28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parser/source/tree_rewriter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def check_range_validity(range)
def enforce_policy(event)
return if @policy[event] == :accept
return unless (values = yield)
trigger_policy(event, values)
trigger_policy(event, **values)
end

POLICY_TO_LEVEL = {warn: :warning, raise: :error}.freeze
Expand Down

0 comments on commit d2c8e28

Please sign in to comment.