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

Disable RuboCop Style/BracesAroundHashParameters #329

Merged

Conversation

Sharpie
Copy link
Member

@Sharpie Sharpie commented May 4, 2020

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

@Sharpie Sharpie requested review from a team as code owners May 4, 2020 20:13
@Sharpie Sharpie force-pushed the disable-rubocop-BracesAroundHashParameters branch from fff7a10 to 2c076db Compare May 4, 2020 20:15
@@ -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
Copy link
Member Author

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
@Sharpie Sharpie force-pushed the disable-rubocop-BracesAroundHashParameters branch from 2c076db to 7e56045 Compare May 4, 2020 21:07
@DavidS
Copy link
Contributor

DavidS commented May 5, 2020

Created https://tickets.puppetlabs.com/browse/IAC-778 to track this.

@DavidS DavidS merged commit 095317c into puppetlabs:master May 5, 2020
@Sharpie Sharpie deleted the disable-rubocop-BracesAroundHashParameters branch May 5, 2020 18:53
alexjfisher added a commit to alexjfisher/pdk-templates that referenced this pull request Aug 10, 2020
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
Copy link
Contributor

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

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

Successfully merging this pull request may close these issues.

4 participants