From e296d58a51037bbe2aeedb3d5602f926091ca626 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 5 May 2026 01:34:41 +1000 Subject: [PATCH] Enable SwiftLint rule: contains_over_filter_count Adds the rule to `only_rules`. No violations in current codebase. The rule going forward will catch `xs.filter { ... }.count > 0` patterns that should use `xs.contains { ... }` instead. Part of the Orchard SwiftLint rollout campaign. --- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Code Opus 4.7 --- .swiftlint.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.swiftlint.yml b/.swiftlint.yml index ef8311c1..46d60390 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -17,6 +17,9 @@ only_rules: # There should be no space before and one after any comma. - comma + # Prefer `contains` over `filter(where:).count`. + - contains_over_filter_count + # Prefer `contains` over using `filter(where:).isEmpty`. - contains_over_filter_is_empty