From b52f3ce0e1f8eba01138606d495901c3358f962f Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 5 May 2026 06:48:02 +1000 Subject: [PATCH] Enable SwiftLint rule: contains_over_range_nil_comparison Adds the rule to `only_rules`. The rule prefers `s.contains(...)` over `s.range(of:) != nil` (and the `== nil` inverse), which is a clarity win. 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..8d2bb4f6 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -20,6 +20,9 @@ only_rules: # Prefer `contains` over using `filter(where:).isEmpty`. - contains_over_filter_is_empty + # Prefer `contains` over `range(of:) != nil` and `range(of:) == nil`. + - contains_over_range_nil_comparison + # if,for,while,do statements shouldn't wrap their conditionals in parentheses. - control_statement