Skip to content

Commit 1ac35fa

Browse files
committed
Apply swiftformat
1 parent 58a6116 commit 1ac35fa

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

ResticScheduler/AdvancedSettings.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class AdvancedSettings: Model {
2323
return _error
2424
}
2525

26+
private let lock = OSAllocatedUnfairLock()
2627
private var needRefresh = true
27-
private var lock = OSAllocatedUnfairLock()
2828
private var _value = ""
2929
private var _error = false
3030

ResticScheduler/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
8181
let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: nil)
8282
self.notificationCenter!.add(request, withCompletionHandler: { error in
8383
guard error == nil else {
84-
TypeLogger.function().warning("Notification request addition error: \(error!.localizedDescription, privacy: .public)")
84+
TypeLogger.function().warning("Couldn't add notification request: \(error!.localizedDescription, privacy: .public)")
8585
return
8686
}
8787
})

ResticScheduler/EditableList.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ class EditableList: Model {
3333
super.init()
3434
publisher = self.data.publisher.sink { [weak self] _ in
3535
guard let self else { return }
36-
guard !self.ignoringChanges else { return }
36+
guard !ignoringChanges else { return }
3737

38-
self.ignoringChanges {
38+
ignoringChanges {
3939
self.selection = nil
4040
self.id = 0
4141
self.list = self.data.wrappedValue.map { value in self.makeListItem(value) }

ResticScheduler/ResticScheduler.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ResticScheduler: Model, ResticSchedulerProtocol {
3939

4040
private var isBackupStale: Bool {
4141
let interval = Duration.seconds(AppEnvironment.shared.backupFrequency)
42-
return self.lastSuccessfulBackup == nil || self.lastSuccessfulBackup!.timeIntervalSinceNow >= TimeInterval(interval.components.seconds * 2)
42+
return lastSuccessfulBackup == nil || lastSuccessfulBackup!.timeIntervalSinceNow >= TimeInterval(interval.components.seconds * 2)
4343
}
4444

4545
override private init() {
@@ -120,7 +120,7 @@ class ResticScheduler: Model, ResticSchedulerProtocol {
120120
backupScheduler!.interval = TimeInterval(interval.components.seconds)
121121
backupScheduler!.repeats = true
122122
backupScheduler!.schedule { [weak self] completion in
123-
guard let self, let scheduler = self.backupScheduler else {
123+
guard let self, let scheduler = backupScheduler else {
124124
completion(.deferred)
125125
return
126126
}
@@ -148,7 +148,7 @@ class ResticScheduler: Model, ResticSchedulerProtocol {
148148
staleBackupScheduler!.qualityOfService = .background
149149
staleBackupScheduler!.interval = TimeInterval(Self.staleBackupCheckInterval.components.seconds)
150150
staleBackupScheduler!.schedule { [weak self] completion in
151-
guard let self, let scheduler = self.staleBackupScheduler else {
151+
guard let self, let scheduler = staleBackupScheduler else {
152152
completion(.deferred)
153153
return
154154
}
@@ -157,7 +157,7 @@ class ResticScheduler: Model, ResticSchedulerProtocol {
157157
completion(.deferred)
158158
return
159159
}
160-
guard self.isBackupStale else {
160+
guard isBackupStale else {
161161
completion(.finished)
162162
return
163163
}
@@ -169,7 +169,7 @@ class ResticScheduler: Model, ResticSchedulerProtocol {
169169
}
170170
}
171171
}
172-
TypeLogger.function().info("Rescheduled stale backup check, interval: \(Self.staleBackupCheckInterval.formatted(.units(allowed: [.days, .hours, .minutes, .seconds], width: .wide)), privacy: .public), stale: \(self.isBackupStale)")
172+
TypeLogger.function().info("Rescheduled stale backup check, interval: \(Self.staleBackupCheckInterval.formatted(.units(allowed: [.days, .hours, .minutes, .seconds], width: .wide)), privacy: .public), stale: \(self.isBackupStale, privacy: .public)")
173173
}
174174
}
175175
}

ResticSchedulerKit/ResticRunner.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ public enum ProcessError: CustomNSError, LocalizedError, _ObjectiveCBridgeableEr
6666

6767
public var errorCode: Int {
6868
switch self {
69-
case .abnormalTermination: return Code.abnormalTermination.rawValue
69+
case .abnormalTermination: Code.abnormalTermination.rawValue
7070
}
7171
}
7272

7373
public var errorUserInfo: [String: Any] {
7474
switch self {
7575
case let .abnormalTermination(terminationStatus, standardError):
76-
return [
76+
[
7777
NSLocalizedDescriptionKey: errorDescription!,
7878
UserInfoKey.terminationStatus.rawValue: terminationStatus,
7979
UserInfoKey.standardError.rawValue: standardError,
@@ -83,7 +83,7 @@ public enum ProcessError: CustomNSError, LocalizedError, _ObjectiveCBridgeableEr
8383

8484
public var errorDescription: String? {
8585
switch self {
86-
case let .abnormalTermination(terminationStatus, standardError): return "Process exited with code \(terminationStatus): \(standardError != "" ? standardError : "<no output>")"
86+
case let .abnormalTermination(terminationStatus, standardError): "Process exited with code \(terminationStatus): \(standardError != "" ? standardError : "<no output>")"
8787
}
8888
}
8989

@@ -115,17 +115,17 @@ public enum BackupError: CustomNSError, LocalizedError, _ObjectiveCBridgeableErr
115115

116116
public var errorCode: Int {
117117
switch self {
118-
case .preparationInProcess: return Code.preparationInProcess.rawValue
119-
case .backupInProcess: return Code.backupInProcess.rawValue
120-
case .backupNotRunning: return Code.backupNotRunning.rawValue
118+
case .preparationInProcess: Code.preparationInProcess.rawValue
119+
case .backupInProcess: Code.backupInProcess.rawValue
120+
case .backupNotRunning: Code.backupNotRunning.rawValue
121121
}
122122
}
123123

124124
public var errorDescription: String? {
125125
switch self {
126-
case .preparationInProcess: return "Backup preparation in process"
127-
case .backupInProcess: return "Backup in process"
128-
case .backupNotRunning: return "Backup not running"
126+
case .preparationInProcess: "Backup preparation in process"
127+
case .backupInProcess: "Backup in process"
128+
case .backupNotRunning: "Backup not running"
129129
}
130130
}
131131

ResticSchedulerKit/Utilities.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ public enum XPCConnectionError: LocalizedError {
99

1010
public var errorDescription: String? {
1111
switch self {
12-
case .connectionInterrupted: return "XPC connection interrupted"
13-
case .connectionInvalidated: return "XPC connection invalidated"
14-
case .invalidRemoteObject: return "Invalid XPC remote object"
15-
case let .remoteMessageFailed(error): return "XPC remote message failed: \(error.localizedDescription)"
12+
case .connectionInterrupted: "XPC connection interrupted"
13+
case .connectionInvalidated: "XPC connection invalidated"
14+
case .invalidRemoteObject: "Invalid XPC remote object"
15+
case let .remoteMessageFailed(error): "XPC remote message failed: \(error.localizedDescription)"
1616
}
1717
}
1818
}

0 commit comments

Comments
 (0)