forked from rubocop/rubocop-factory_bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix rubocop#135] false positive for omit_parentheses
When ConsistentParenthesesStyle is :omit_parentheses, we ignore factory calls that have an omitted hash value (ruby 3.1 shorthand syntax). Parentheses are required if the arguments end with the key of the omitted value. (e.g. `create(:user, name:)`) However, if a trait was used, (e.g. `create(:user, :trait, name:)`) omit_hash_value? matcher did not match it, and thus would remove the parentheses, potentially causing a syntax error. This change adds a wildcard to the omit_hash_value? matcher to allow any number of symbols/traits at the start of the pattern (before the hash values). see rubocop#135
- Loading branch information
1 parent
88891a3
commit 8fea49c
Showing
3 changed files
with
13 additions
and
1 deletion.
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
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