-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Style/HashSyntax: Omit the hash value cases
There are certain cases that suggestion of Style/HashSyntax: Omit the hash value and then the autocorrect will produce invalid syntax This change acts conservative and does not change/suggest a code change for those cases. Related with #10289 Example: RSpec.shared_examples 'Examples' do |option_a:| include_examples 'Example A', option_a: option_a if option_a # Omitting the option_a value would produce invalid syntax include_examples 'Example B', option_a: option_a # Omitting the option_a value would produce invalid syntax describe '.describe' do it { true } end include_examples 'Example C', option_a: option_a # Valid omission end
- Loading branch information
Showing
3 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#10357](https://github.com/rubocop/rubocop/pull/10357): Fix a false positive for `Style/HashSyntax` when omitting the value. ([@berkos][]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters