codeclimate-rubocop
codeclimate-rubocop copied to clipboard
Confusing `Style/HashSyntax` warnings in CC, nothing in local.
In the following snippet of code, the action method call is resulting in 5 separate Style/HashSyntax warnings from the rubocop engine while my local rubocop check gives me none:
def monitor_check_add(name:, type:, fail_count:, success_count:, check_interval:,
**from_check_type)
action(:monitor, :"check-add", name: name, type: type, fail_count: fail_count,
success_count: success_count, check_interval: check_interval, **from_check_type)
end
Since there are 5 warnings, I'm guessing those are the 5 required keyword arguments in the call. I have many lines of code like this that are not causing any warnings, although this is the only line with a hash-splat parameter (**from_check_type) in the call.
Hm interesting. Thanks for opening the issue.
Which version of rubocop are you running? We're (currently) running 0.46 in the engine.
Aha! Does seem to be a problem with Rubocop 0.46. I'm running 0.47.1 without the error, but when I manually dropped down to 0.46 it appeared locally.
Looks like it's bbatsov/rubocop#3898 (see also https://github.com/twe4ked/rubocop-mixed-hash-test) which appears to be fixed by 0.47.