From 317df3ee9902c5eb6af2c033529943a52319839e Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 24 Mar 2026 11:23:25 +1100 Subject: [PATCH 1/2] Enable SwiftLint rule: `empty_count` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Zero violations found — the codebase already conforms. Part of the Orchard SwiftLint rollout campaign. --- Generated with the help of Claude Code, https://code.claude.com Co-Authored-By: Claude Code Opus 4.6 --- .swiftlint.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.swiftlint.yml b/.swiftlint.yml index d9c31cc7..cf0faf5e 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -23,6 +23,9 @@ only_rules: # if,for,while,do statements shouldn't wrap their conditionals in parentheses. - control_statement + # Prefer checking `isEmpty` over comparing `count` to zero. + - empty_count + # Arguments can be omitted when matching enums with associated types if they # are not used. - empty_enum_arguments From 9296d826bf4dfc72b330f79d1a4f9ac92a32367e Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 9 Apr 2026 09:54:23 +1000 Subject: [PATCH 2/2] Fix missed `empty_count` violation The test file was using `.count > 0` instead of `!.isEmpty`. --- Generated with the help of Claude Code, https://code.claude.com Co-Authored-By: Claude Opus 4.6 (1M context) --- Tests/Tests/Event Logging/LogEncryptionTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Tests/Event Logging/LogEncryptionTests.swift b/Tests/Tests/Event Logging/LogEncryptionTests.swift index 35336189..fceb1bd7 100644 --- a/Tests/Tests/Event Logging/LogEncryptionTests.swift +++ b/Tests/Tests/Event Logging/LogEncryptionTests.swift @@ -57,7 +57,7 @@ class LogEncryptionTests: XCTestCase { XCTAssertNotNil(UUID(uuidString: encryptedMessage.uuid), "The UUID must be valid") XCTAssertEqual(encryptedMessage.header.count, 32, "The header should be 32 bytes long") XCTAssertEqual(encryptedMessage.encryptedKey.count, 108, "The encrypted key should be 108 bytes long") - XCTAssert(encryptedMessage.messages.count > 0, "There should be at least one message") + XCTAssertFalse(encryptedMessage.messages.isEmpty, "There should be at least one message") } }