-
-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a false positive for
Rails/DynamicFindBy
This PR fixes a false positive for `Rails/DynamicFindBy` when any of the arguments are splat argument. ```console % cat example.rb find_by_scan(*args) % bundle exec rubocop -a example.rb (snip) Inspecting 1 file E Offenses: example.rb:1:1: C: [Corrected] Rails/DynamicFindBy: Use find_by instead of dynamic find_by_scan. find_by_scan(*args) ^^^^^^^^^^^^^^^^^^^ example.rb:1:15: E: Lint/Syntax: unexpected token tSTAR (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops) find_by(scan: *args) ^ 1 file inspected, 2 offenses detected, 1 offense corrected % cat example.rb find_by(scan: *args) % ruby -c example.rb example.rb:1: syntax error, unexpected * find_by(scan: *args) ```
- Loading branch information
Showing
3 changed files
with
10 additions
and
0 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
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