From 6aed65016a69658a5af08c5a665d24d46b8e18ab Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Wed, 4 Sep 2019 18:26:41 +0900 Subject: [PATCH] Follow "Separate Keyword Arguments from Positional Arguments" Follow https://github.com/ruby/ruby/pull/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 following Ruby 2.7's warning. ```console % cd path/to/parser % bundle exec rake (snip) /Users/koic/src/github.com/whitequark/parser/lib/parser/source/tree_rewriter.rb:284: warning: The last argument for `trigger_policy' (defined at /Users/koic/src/github.com/whitequark/parser/lib/parser/source/tree_rewriter.rb:288) is used as the keyword parameter ``` --- lib/parser/source/tree_rewriter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/parser/source/tree_rewriter.rb b/lib/parser/source/tree_rewriter.rb index 85d950052..97268668d 100644 --- a/lib/parser/source/tree_rewriter.rb +++ b/lib/parser/source/tree_rewriter.rb @@ -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