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

Fix bad merge for Style/OptionHash #2105

Merged
merged 2 commits into from
Aug 6, 2015
Merged

Fix bad merge for Style/OptionHash #2105

merged 2 commits into from
Aug 6, 2015

Conversation

wli
Copy link
Contributor

@wli wli commented Aug 5, 2015

This line was introduced in a5be58e, but accidentally deleted when merging 35ef5ed.

I put this in my .rubocop.yml file.

Style/OptionHash:
  Enabled: true

And got the following error:

Warning: unrecognized parameter Style/OptionHash:Enabled found in .rubocop.yml

It looks like we need to specify Enabled: false by default for it not to complain.

@wli wli force-pushed the patch-1 branch 3 times, most recently from 4ea259a to 3f75d76 Compare August 5, 2015 21:27
wli added 2 commits August 5, 2015 14:37
This line was introduced in a5be58e, but accidentally deleted when merging 35ef5ed.

I put this in my .rubocop.yml file.
````
Style/OptionHash:
  Enabled: true
````

And got the following error:

````
Warning: unrecognized parameter Style/OptionHash:Enabled found in .rubocop.yml
````

It looks like we need to specify `Enabled: false` by default for it not to complain.
@maxjacobson
Copy link
Contributor

Oo good catch!

bbatsov added a commit that referenced this pull request Aug 6, 2015
Fix bad merge for Style/OptionHash
@bbatsov bbatsov merged commit 2609320 into rubocop:master Aug 6, 2015
@bbatsov
Copy link
Collaborator

bbatsov commented Aug 6, 2015

👍 Thanks!

@jfelchner
Copy link
Contributor

@wli is it correct that I should still be getting this error even if I put:

Style/OptionHash:
  Enabled: true

In my rubocop.yml?

@wli
Copy link
Contributor Author

wli commented Aug 6, 2015

@jfelchner Which version of rubocop are you running? This fix is only in master, and hasn't been released yet.

@jfelchner
Copy link
Contributor

@wli latest but I figured since all it was, was adding that to the YAML file, I could just add it to my YAML file and fix it myself.

@wli
Copy link
Contributor Author

wli commented Aug 6, 2015

@jfelchner Unfortunately it seems like rubocop complains if the Enabled declaration is missing from https://github.com/bbatsov/rubocop/blob/master/config/default.yml. This is what I fixed in this PR.

Not sure really how the internals play out and if there's any way to fix it yourself locally, but luckily it's just a warning and won't block. Maybe @bbatsov can shine some light on this?

@jfelchner
Copy link
Contributor

👍

@jonas054
Copy link
Collaborator

@wli The warning for unrecognized parameter is issued when local configuration contains a parameter that's not found in default configuration, i.e., config/default.yml or the files it inherits from. See Config#validate_parameter_names. So when a parameter is missing in default configuration, it can't be fixed in local configuration.

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

Successfully merging this pull request may close these issues.

5 participants