From d8b19ced7429bc36c1aac6ae9842cccc9776eefe Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 5 May 2026 10:57:23 +1000 Subject: [PATCH] Enable SwiftLint rule: flatmap_over_map_reduce MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the rule to `only_rules`. The rule prefers `flatMap { ... }` over `map { ... }.reduce([], +)` for flattening nested arrays — this avoids materialising an intermediate array of arrays. 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..eccf9282 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -39,6 +39,9 @@ only_rules: # Empty strings should be compared to `""` only if `isEmpty` cannot be used. - empty_string + # Prefer `flatMap { ... }` over `map { ... }.reduce([], +)`. + - flatmap_over_map_reduce + # MARK comment should be in valid format. - mark