From 3bedd832e262323e2d4e8e586599d933733e84e6 Mon Sep 17 00:00:00 2001 From: Bradley Mackey Date: Sun, 13 Sep 2026 17:25:56 +0400 Subject: [PATCH 1/2] Update all outdated Swift package dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Brings every dependency to its latest release. Six were behind: - swift-snapshot-testing 1.19.2 -> 1.19.4 - BigInt 5.7.0 -> 6.0.1 - swift-argument-parser 1.6.2 -> 1.8.2 - swift-syntax 600.0.1 -> 603.0.2 - SwiftLintPlugins 0.63.3 -> 0.65.1 - SwiftFormat 0.61.1 -> 0.63.0 swift-syntax was the only dependency declared with `from:` rather than `exact:`, which is why it stayed on 600.0.1 — SwiftPM treats 600 and 603 as separate majors, so the range never reached the current release. It is now pinned `exact:` to match every other dependency and to keep drift visible. BigInt's 5.x -> 6.x major bump carries no API change; it reflects a swift-tools-version move to 6.0. Platform requirements are unchanged. Tooling updates required two source changes: - SwiftLint 0.65.1 adds `legacy_swiftui_aspect_ratio`, which flagged the single use of `.aspectRatio(contentMode: .fit)`. Replaced with the equivalent `.scaledToFit()`. - SwiftFormat 0.63.0 expands single-line `if` bodies onto their own lines and strips redundant SwiftUI `Group` wrappers, adding `@ViewBuilder` where the wrapper was load-bearing for the builder context. All formatting changes are layout-only — no branch, condition, or error path was altered. Co-Authored-By: Claude Opus 5 (1M context) --- .../xcshareddata/swiftpm/Package.resolved | 22 +++++----- Vault/Package.resolved | 22 +++++----- Vault/Package.swift | 14 +++--- .../Symmetric/AESGCMDecryptor.swift | 4 +- .../Extensions/Task+Race.swift | 4 +- .../Sources/FoundationExtensions/SemVer.swift | 8 +++- .../VaultExportDataBlockGenerator.swift | 4 +- .../Helpers/Floating+Equality.swift | 8 +++- .../BackupImportScanningHandler.swift | 4 +- .../OTPCode/OTPCodeTimerState.swift | 8 +++- .../VaultFeed/Storage/VaultDataModel.swift | 12 +++-- .../Views/Backup/AutoBackupSettingsView.swift | 8 +++- .../Views/Backup/PDFPageViewerView.swift | 2 +- .../Views/Detail/OTP/OTPCodeDetailView.swift | 25 +++++------ .../VaultDetailKillphraseEditView.swift | 4 +- .../Views/Feed/VaultItemFeedReorderer.swift | 4 +- .../Views/Feed/VaultItemFeedView.swift | 4 +- .../Views/VaultAutofillView.swift | 44 +++++++++---------- .../KillphraseRehashServiceTests.swift | 4 +- .../SearchPassphraseRehashServiceTests.swift | 4 +- 20 files changed, 123 insertions(+), 86 deletions(-) diff --git a/Vault.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Vault.xcworkspace/xcshareddata/swiftpm/Package.resolved index b0cb0ee42..66ffb66ca 100644 --- a/Vault.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Vault.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,13 +1,13 @@ { - "originHash" : "9a84befbaaf952ed7a8b8c122c3dfb2225e633a65c7ab9812a3b86103d53a1dc", + "originHash" : "ea1e5803d89e94cebc061b30e19ef87b76102dd1c8d9e5f6636e26eefb6c378d", "pins" : [ { "identity" : "bigint", "kind" : "remoteSourceControl", "location" : "https://github.com/attaswift/BigInt.git", "state" : { - "revision" : "e07e00fa1fd435143a2dcf8b7eec9a7710b2fdfe", - "version" : "5.7.0" + "revision" : "63feef7820abb1a8fb08587d7da56bb0b7db8751", + "version" : "6.0.1" } }, { @@ -42,8 +42,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-argument-parser", "state" : { - "revision" : "cdd0ef3755280949551dc26dee5de9ddeda89f54", - "version" : "1.6.2" + "revision" : "6a52f3251125d74daf04fcbd5e6f08a75d074382", + "version" : "1.8.2" } }, { @@ -87,8 +87,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-snapshot-testing", "state" : { - "revision" : "ad5e3190cc63dc288f28546f9c6827efc1e9d495", - "version" : "1.19.2" + "revision" : "59a99c458de4d2dee580529b61b4f78dca7b7fa6", + "version" : "1.19.4" } }, { @@ -96,8 +96,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/swiftlang/swift-syntax", "state" : { - "revision" : "0687f71944021d616d34d922343dcef086855920", - "version" : "600.0.1" + "revision" : "79e4b74a295b6eb74a8b585e3a39d29e70c1dbd1", + "version" : "603.0.2" } }, { @@ -105,8 +105,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/SimplyDanny/SwiftLintPlugins", "state" : { - "revision" : "18d8d2d18e1668006d1d209e0b5f5e06c1da7cb5", - "version" : "0.63.3" + "revision" : "ef7d692fc6706e8f5628e26bcafaefa445c58a97", + "version" : "0.65.1" } }, { diff --git a/Vault/Package.resolved b/Vault/Package.resolved index b0cb0ee42..66ffb66ca 100644 --- a/Vault/Package.resolved +++ b/Vault/Package.resolved @@ -1,13 +1,13 @@ { - "originHash" : "9a84befbaaf952ed7a8b8c122c3dfb2225e633a65c7ab9812a3b86103d53a1dc", + "originHash" : "ea1e5803d89e94cebc061b30e19ef87b76102dd1c8d9e5f6636e26eefb6c378d", "pins" : [ { "identity" : "bigint", "kind" : "remoteSourceControl", "location" : "https://github.com/attaswift/BigInt.git", "state" : { - "revision" : "e07e00fa1fd435143a2dcf8b7eec9a7710b2fdfe", - "version" : "5.7.0" + "revision" : "63feef7820abb1a8fb08587d7da56bb0b7db8751", + "version" : "6.0.1" } }, { @@ -42,8 +42,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-argument-parser", "state" : { - "revision" : "cdd0ef3755280949551dc26dee5de9ddeda89f54", - "version" : "1.6.2" + "revision" : "6a52f3251125d74daf04fcbd5e6f08a75d074382", + "version" : "1.8.2" } }, { @@ -87,8 +87,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-snapshot-testing", "state" : { - "revision" : "ad5e3190cc63dc288f28546f9c6827efc1e9d495", - "version" : "1.19.2" + "revision" : "59a99c458de4d2dee580529b61b4f78dca7b7fa6", + "version" : "1.19.4" } }, { @@ -96,8 +96,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/swiftlang/swift-syntax", "state" : { - "revision" : "0687f71944021d616d34d922343dcef086855920", - "version" : "600.0.1" + "revision" : "79e4b74a295b6eb74a8b585e3a39d29e70c1dbd1", + "version" : "603.0.2" } }, { @@ -105,8 +105,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/SimplyDanny/SwiftLintPlugins", "state" : { - "revision" : "18d8d2d18e1668006d1d209e0b5f5e06c1da7cb5", - "version" : "0.63.3" + "revision" : "ef7d692fc6706e8f5628e26bcafaefa445c58a97", + "version" : "0.65.1" } }, { diff --git a/Vault/Package.swift b/Vault/Package.swift index 88968a954..690b6f04b 100644 --- a/Vault/Package.swift +++ b/Vault/Package.swift @@ -3,9 +3,9 @@ import CompilerPluginSupport import PackageDescription -let swiftLintVersion: Version = "0.63.3" -let swiftFormatVersion: Version = "0.61.1" -let swiftFormatChecksum: String = "47f7932f35c714b00430f56df1cfaf1bea0b4baae299bb2a09874cb52ee45350" +let swiftLintVersion: Version = "0.65.1" +let swiftFormatVersion: Version = "0.63.0" +let swiftFormatChecksum: String = "d3c350a6655c0f687e2c23aac3e777b35345313a6428bb36b915fe7d9840ec78" let swiftSettings: [SwiftSetting] = [ .enableUpcomingFeature("ExistentialAny"), @@ -47,16 +47,16 @@ let package = Package( .plugin(name: "FormatLint", targets: ["FormatLint"]), ], dependencies: [ - .package(url: "https://github.com/pointfreeco/swift-snapshot-testing", exact: "1.19.2"), - .package(url: "https://github.com/attaswift/BigInt.git", exact: "5.7.0"), + .package(url: "https://github.com/pointfreeco/swift-snapshot-testing", exact: "1.19.4"), + .package(url: "https://github.com/attaswift/BigInt.git", exact: "6.0.1"), .package(url: "https://github.com/krzyzanowskim/CryptoSwift", exact: "1.10.0"), .package(url: "https://github.com/sunghyun-k/swiftui-toasts.git", exact: "1.1.1"), - .package(url: "https://github.com/apple/swift-argument-parser", exact: "1.6.2"), + .package(url: "https://github.com/apple/swift-argument-parser", exact: "1.8.2"), .package(url: "https://github.com/twostraws/CodeScanner", exact: "2.5.2"), .package(url: "https://github.com/dm-zharov/swift-security.git", exact: "2.5.1"), .package(url: "https://github.com/gonzalezreal/swift-markdown-ui", exact: "2.4.1"), .package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", exact: swiftLintVersion), - .package(url: "https://github.com/swiftlang/swift-syntax", from: "600.0.0"), + .package(url: "https://github.com/swiftlang/swift-syntax", exact: "603.0.2"), ], targets: [ .target( diff --git a/Vault/Sources/CryptoEngine/Symmetric/AESGCMDecryptor.swift b/Vault/Sources/CryptoEngine/Symmetric/AESGCMDecryptor.swift index cef4e74f0..89c3da42d 100644 --- a/Vault/Sources/CryptoEngine/Symmetric/AESGCMDecryptor.swift +++ b/Vault/Sources/CryptoEngine/Symmetric/AESGCMDecryptor.swift @@ -19,7 +19,9 @@ public struct AESGCMDecryptor: Decryptor { public func decrypt(message: Message, iv: Data) throws -> Data { let gcm = GCM(iv: iv.byteArray, authenticationTag: message.authenticationTag.byteArray, mode: .detached) let aes = try AES(key: key.byteArray, blockMode: gcm, padding: .noPadding) - if message.ciphertext.isEmpty { return Data() } + if message.ciphertext.isEmpty { + return Data() + } let plaintextBytes = try aes.decrypt(message.ciphertext.byteArray) return Data(plaintextBytes) } diff --git a/Vault/Sources/FoundationExtensions/Extensions/Task+Race.swift b/Vault/Sources/FoundationExtensions/Extensions/Task+Race.swift index 54f2d403b..ec22659c2 100644 --- a/Vault/Sources/FoundationExtensions/Extensions/Task+Race.swift +++ b/Vault/Sources/FoundationExtensions/Extensions/Task+Race.swift @@ -59,7 +59,9 @@ extension Task where Failure == any Error { ) async throws -> Success? { try await withThrowingTaskGroup(of: Success.self) { group -> Success? in try Task.checkCancellation() - if tasks.isEmpty { throw TaskRaceError.noTasksScheduled } + if tasks.isEmpty { + throw TaskRaceError.noTasksScheduled + } for task in tasks { group.addTask(priority: priority) { try await task() diff --git a/Vault/Sources/FoundationExtensions/SemVer.swift b/Vault/Sources/FoundationExtensions/SemVer.swift index d18448bb2..131b120c7 100644 --- a/Vault/Sources/FoundationExtensions/SemVer.swift +++ b/Vault/Sources/FoundationExtensions/SemVer.swift @@ -53,8 +53,12 @@ extension SemVer: Codable { extension SemVer: Comparable { public static func < (lhs: SemVer, rhs: SemVer) -> Bool { - if lhs.major < rhs.major { return true } - if lhs.major == rhs.major, lhs.minor < rhs.minor { return true } + if lhs.major < rhs.major { + return true + } + if lhs.major == rhs.major, lhs.minor < rhs.minor { + return true + } return lhs.major == rhs.major && lhs.minor == rhs.minor && lhs.patch < rhs.patch } diff --git a/Vault/Sources/VaultBackup/Export/VaultExportDataBlockGenerator.swift b/Vault/Sources/VaultBackup/Export/VaultExportDataBlockGenerator.swift index 4e5a35f58..e0277415f 100644 --- a/Vault/Sources/VaultBackup/Export/VaultExportDataBlockGenerator.swift +++ b/Vault/Sources/VaultBackup/Export/VaultExportDataBlockGenerator.swift @@ -43,7 +43,9 @@ extension VaultExportDataBlockGenerator { payload.userDescription .split(separator: "\n") .compactMap { text in - if text.isEmpty { return nil } + if text.isEmpty { + return nil + } return .init( text: String(text), font: .systemFont(ofSize: 10), diff --git a/Vault/Sources/VaultExport/Helpers/Floating+Equality.swift b/Vault/Sources/VaultExport/Helpers/Floating+Equality.swift index cc766973a..912667781 100644 --- a/Vault/Sources/VaultExport/Helpers/Floating+Equality.swift +++ b/Vault/Sources/VaultExport/Helpers/Floating+Equality.swift @@ -72,9 +72,13 @@ extension FloatingPoint { func rescaledAlmostEqual(to other: Self, tolerance: Self) -> Bool { // NaN is considered to be not approximately equal to anything, not even // itself. - if isNaN || other.isNaN { return false } + if isNaN || other.isNaN { + return false + } if isInfinite { - if other.isInfinite { return self == other } + if other.isInfinite { + return self == other + } // Self is infinite and other is finite. Replace self with the binade // of the greatestFiniteMagnitude, and reduce the exponent of other by // one to compensate. diff --git a/Vault/Sources/VaultFeed/CodeScanner/BackupImportScanningHandler.swift b/Vault/Sources/VaultFeed/CodeScanner/BackupImportScanningHandler.swift index 54a1641aa..45ba12163 100644 --- a/Vault/Sources/VaultFeed/CodeScanner/BackupImportScanningHandler.swift +++ b/Vault/Sources/VaultFeed/CodeScanner/BackupImportScanningHandler.swift @@ -38,7 +38,9 @@ public final class BackupImportScanningHandler: CodeScanningHandler { let shardData = Data(data.utf8) do { try shardDecoder.add(shardData: shardData) - if !shardDecoder.isReadyToDecode { return .continueScanning(.success) } + if !shardDecoder.isReadyToDecode { + return .continueScanning(.success) + } } catch let error as DataShardDecoder.AddShardError where error.canIgnoreError { return .continueScanning(.ignore) } catch { diff --git a/Vault/Sources/VaultFeed/Presentation/OTPCode/OTPCodeTimerState.swift b/Vault/Sources/VaultFeed/Presentation/OTPCode/OTPCodeTimerState.swift index ca826db1a..4bf5a64c5 100644 --- a/Vault/Sources/VaultFeed/Presentation/OTPCode/OTPCodeTimerState.swift +++ b/Vault/Sources/VaultFeed/Presentation/OTPCode/OTPCodeTimerState.swift @@ -38,10 +38,14 @@ extension OTPCodeTimerState { /// /// This will only give an output `0...1`. public func fractionCompleted(at epoch: Double) -> Double { - if totalTime == 0 { return 1 } + if totalTime == 0 { + return 1 + } let remainingTime = remainingTime(at: epoch) let remainingFraction = remainingTime / totalTime - if remainingFraction < 0 { return 0 } + if remainingFraction < 0 { + return 0 + } let fractionCompleted = 1 - remainingFraction return fractionCompleted.clamped(to: 0 ... 1) } diff --git a/Vault/Sources/VaultFeed/Storage/VaultDataModel.swift b/Vault/Sources/VaultFeed/Storage/VaultDataModel.swift index 1b6fe8b81..cb8f4c41b 100644 --- a/Vault/Sources/VaultFeed/Storage/VaultDataModel.swift +++ b/Vault/Sources/VaultFeed/Storage/VaultDataModel.swift @@ -184,7 +184,9 @@ public final class VaultDataModel { /// for the lifetime of the unlocked-device session. Safe to call /// multiple times — no-op if digester is already built. public func loadKillphraseDigester() async { - if killphraseDigester != nil { return } + if killphraseDigester != nil { + return + } do { let key = try await killphraseKeyStore.loadOrCreate() let digester = KillphraseDigester(key: key) @@ -205,7 +207,9 @@ public final class VaultDataModel { /// shape as `loadKillphraseDigester`; failure leaves passphrase /// matching disabled until next launch. public func loadSearchPassphraseDigester() async { - if searchPassphraseDigester != nil { return } + if searchPassphraseDigester != nil { + return + } do { let key = try await searchPassphraseKeyStore.loadOrCreate() let digester = SearchPassphraseDigester(key: key) @@ -272,7 +276,9 @@ extension VaultDataModel { extension VaultDataModel { public func loadBackupPassword() async { do { - if case .fetched = backupPassword { return } + if case .fetched = backupPassword { + return + } backupPasswordLoadingState = .loading defer { backupPasswordLoadingState = .notLoading } let password = try await backupPasswordStore.fetchPassword() diff --git a/Vault/Sources/VaultiOS/Views/Backup/AutoBackupSettingsView.swift b/Vault/Sources/VaultiOS/Views/Backup/AutoBackupSettingsView.swift index 2b7b270a2..7f1bde3d0 100644 --- a/Vault/Sources/VaultiOS/Views/Backup/AutoBackupSettingsView.swift +++ b/Vault/Sources/VaultiOS/Views/Backup/AutoBackupSettingsView.swift @@ -283,8 +283,12 @@ struct AutoBackupSettingsView: View { } private var isBackingUp: Bool { - if case .backingUp = status { return true } - if case .cleaningUp = status { return true } + if case .backingUp = status { + return true + } + if case .cleaningUp = status { + return true + } return false } diff --git a/Vault/Sources/VaultiOS/Views/Backup/PDFPageViewerView.swift b/Vault/Sources/VaultiOS/Views/Backup/PDFPageViewerView.swift index 2deea4aa6..25cf58b25 100644 --- a/Vault/Sources/VaultiOS/Views/Backup/PDFPageViewerView.swift +++ b/Vault/Sources/VaultiOS/Views/Backup/PDFPageViewerView.swift @@ -21,7 +21,7 @@ struct PDFPageViewerView: View { if let image = pageImage(for: geometry.size) { Image(uiImage: image) .resizable() - .aspectRatio(contentMode: .fit) + .scaledToFit() .scaleEffect(scale) .offset(offset) .gesture(magnificationGesture) diff --git a/Vault/Sources/VaultiOS/Views/Detail/OTP/OTPCodeDetailView.swift b/Vault/Sources/VaultiOS/Views/Detail/OTP/OTPCodeDetailView.swift index 60935a666..2c63f30ce 100644 --- a/Vault/Sources/VaultiOS/Views/Detail/OTP/OTPCodeDetailView.swift +++ b/Vault/Sources/VaultiOS/Views/Detail/OTP/OTPCodeDetailView.swift @@ -318,20 +318,19 @@ struct OTPCodeDetailView from { to += 1 } + if to > from { + to += 1 + } let targetPosition: VaultReorderingPosition = if to == 0 { .start } else { diff --git a/Vault/Sources/VaultiOS/Views/Feed/VaultItemFeedView.swift b/Vault/Sources/VaultiOS/Views/Feed/VaultItemFeedView.swift index f57fa4fe4..5bdb90b17 100644 --- a/Vault/Sources/VaultiOS/Views/Feed/VaultItemFeedView.swift +++ b/Vault/Sources/VaultiOS/Views/Feed/VaultItemFeedView.swift @@ -247,7 +247,9 @@ public struct VaultItemFeedView< } } .onChange(of: state.isEditing) { _, isEditing in - if !isEditing { targetedIds.removeAll() } + if !isEditing { + targetedIds.removeAll() + } } } diff --git a/Vault/Sources/VaultiOSAutofill/Views/VaultAutofillView.swift b/Vault/Sources/VaultiOSAutofill/Views/VaultAutofillView.swift index 7b387318e..2480863e8 100644 --- a/Vault/Sources/VaultiOSAutofill/Views/VaultAutofillView.swift +++ b/Vault/Sources/VaultiOSAutofill/Views/VaultAutofillView.swift @@ -19,30 +19,28 @@ struct VaultAutofillView Date: Sun, 13 Sep 2026 17:38:00 +0400 Subject: [PATCH 2/2] Align SwiftFormat's declared Swift version with the toolchain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `.swiftformat` declared `--swiftversion 6.2` while the project builds with the Xcode 27 toolchain, which is Swift 6.4. SwiftFormat uses this value to gate version-conditional rules, so a stale value silently holds back rules that only apply at newer language versions. Reformatting with 6.4 produces no source changes at all — the only diff is the config line itself. The bump is purely so future version-gated rules evaluate against the correct version. Co-Authored-By: Claude Opus 5 (1M context) --- Vault/.swiftformat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vault/.swiftformat b/Vault/.swiftformat index e7e807404..26887761d 100644 --- a/Vault/.swiftformat +++ b/Vault/.swiftformat @@ -1,6 +1,6 @@ # format options ---swiftversion 6.2 +--swiftversion 6.4 --allman false --binarygrouping 4,8