From 0e2951b5627cf0a3371d185b9571e6be082d5aaa Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 5 May 2026 10:03:07 +1000 Subject: [PATCH] Enable SwiftLint rule: sorted_first_last Adds the rule to `only_rules`. The rule prefers `min(by:)` / `max(by:)` over `sorted { ... }.first` / `.last`, which avoids materialising a full sorted array. 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..4554d747 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -54,6 +54,9 @@ only_rules: # `if let foo = foo`). - shorthand_optional_binding + # Prefer `min(by:)` / `max(by:)` over `sorted { ... }.first` / `.last`. + - sorted_first_last + # Files should have a single trailing newline. - trailing_newline