-
Notifications
You must be signed in to change notification settings - Fork 142
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
Disable RuboCop Style/BracesAroundHashParameters #329
Disable RuboCop Style/BracesAroundHashParameters #329
Conversation
fff7a10
to
2c076db
Compare
@@ -159,6 +159,10 @@ Rakefile: | |||
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to be consistent then. | |||
EnforcedStyle: braces_for_chaining | |||
|
|||
Style/BracesAroundHashParameters: | |||
Description: Braces are required by Ruby 2.7. Cop removed from RuboCop v0.80.0: https://github.com/rubocop-hq/rubocop/pull/7643 | |||
Enabled: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is repetitive, but it seems good to have a "Description" that tells people why this one is disabled. Open to arguments against it though.
The `Style/BracesAroundHashParameters` cop would flag "redundant" uses of braces to create hashes in Ruby method arguments. Ruby 2.7 requires these braces to disambiguate hash literals from keyword arguments and will issue warnings. The cop has been removed from RuboCop v0.80.0. See: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ See: rubocop/rubocop#7643
2c076db
to
7e56045
Compare
Created https://tickets.puppetlabs.com/browse/IAC-778 to track this. |
Despite puppetlabs#329 (which aimed to disable this cop), in the last round of module updates, it is set as `enabled: true` in all puppetlabs modules. Removing the line from the cleanup_cops seems to fix this.
@@ -223,7 +223,6 @@ | |||
- Style/BeginBlock | |||
- Style/BlockComments | |||
- Style/BlockDelimiters | |||
- Style/BracesAroundHashParameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was not enough to stop the cop being enabled
everywhere. See #344
The
Style/BracesAroundHashParameters
cop would flag "redundant" usesof braces to create hashes in Ruby method arguments. Ruby 2.7 requires
these braces to disambiguate hash literals from keyword arguments and
will issue warnings. The cop has been removed from RuboCop v0.80.0.
See: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
See: rubocop/rubocop#7643