Skip to content

Commit

Permalink
[first_where] Add false positives from #1930 as non-triggering examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed Feb 12, 2019
1 parent dde13e4 commit 8237d3e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Rules.md
Expand Up @@ -7591,6 +7591,14 @@ match(pattern: pattern).filter { $0.first == .identifier }
collection.filter("stringCol = '3'").first
```

```swift
realm?.objects(User.self).filter(NSPredicate(format: "email ==[c] %@", email)).first
```

```swift
} else if let pause = timeTracker.pauses.filter("beginDate < %@", beginDate).first {
```

</details>
<details>
<summary>Triggering Examples</summary>
Expand Down
Expand Up @@ -16,7 +16,9 @@ public struct FirstWhereRule: CallPairRule, OptInRule, ConfigurationProviderRule
"myList.first(where: { $0 % 2 == 0 })\n",
"match(pattern: pattern).filter { $0.first == .identifier }\n",
"(myList.filter { $0 == 1 }.suffix(2)).first\n",
"collection.filter(\"stringCol = '3'\").first"
"collection.filter(\"stringCol = '3'\").first",
"realm?.objects(User.self).filter(NSPredicate(format: \"email ==[c] %@\", email)).first",
"} else if let pause = timeTracker.pauses.filter(\"beginDate < %@\", beginDate).first {"
],
triggeringExamples: [
"↓myList.filter { $0 % 2 == 0 }.first\n",
Expand Down

0 comments on commit 8237d3e

Please sign in to comment.