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

Confusing Style/HashSyntax warnings in CC, nothing in local. #88

Open
nomoon opened this issue Feb 10, 2017 · 3 comments
Open

Confusing Style/HashSyntax warnings in CC, nothing in local. #88

nomoon opened this issue Feb 10, 2017 · 3 comments

Comments

@nomoon
Copy link

nomoon commented Feb 10, 2017

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.

@maxjacobson
Copy link
Contributor

Hm interesting. Thanks for opening the issue.

Which version of rubocop are you running? We're (currently) running 0.46 in the engine.

@nomoon
Copy link
Author

nomoon commented Feb 15, 2017

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.

@nomoon
Copy link
Author

nomoon commented Feb 15, 2017

Looks like it's rubocop/rubocop#3898 (see also https://github.com/twe4ked/rubocop-mixed-hash-test) which appears to be fixed by 0.47.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants