chore(format): disable redundantSelf + redundantSendable in swiftformat
Default `--self remove` strippt `self.` aus @autoclosure-Calls (Logger.info) und Closure-Captures, was Swift-6-strict-concurrency dann als "implicit use of self in closure" rejected. Default `redundantSendable` strippt `Sendable` von Codable-DTOs, die über actor-Grenzen wandern müssen. Beide Regeln aus. Zusätzlich Lauf über alle Files: harmlose Whitespace-/ Trailing-Comma-/Optional-Init-Normalisierung in 5 Files. `self.` und `Sendable` bleiben überall erhalten. Build grün. Hintergrund: η-0-Lauf hat das aktiv gemacht und Submit-DTOs zerschossen, die ich dann von Hand revertieren musste. Dieser Commit verhindert die Wiederholung in η-1+. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1d770123f5
commit
f5a26b2392
6 changed files with 55 additions and 41 deletions
|
|
@ -75,7 +75,9 @@ struct QuoteDraft: Codable, Sendable, Equatable {
|
|||
|
||||
enum SourceKind: String, Codable, Sendable, CaseIterable, Identifiable {
|
||||
case book, article, talk, film, other
|
||||
var id: String { rawValue }
|
||||
var id: String {
|
||||
rawValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ enum PendingSubmissionContainer {
|
|||
|
||||
static func make(inMemory: Bool = false) throws -> ModelContainer {
|
||||
let schema = Schema([PendingSubmission.self])
|
||||
let config: ModelConfiguration = if inMemory {
|
||||
let config = if inMemory {
|
||||
ModelConfiguration(schema: schema, isStoredInMemoryOnly: true)
|
||||
} else {
|
||||
ModelConfiguration("submissions", schema: schema, url: defaultStoreURL())
|
||||
|
|
|
|||
|
|
@ -11,30 +11,30 @@ import OSLog
|
|||
/// reale App startet Watcher einmal beim Launch und lässt ihn bis
|
||||
/// zum Prozess-Ende laufen.
|
||||
final class ReachabilityWatcher: @unchecked Sendable {
|
||||
private let monitor = NWPathMonitor()
|
||||
private let queue = DispatchQueue(label: "ev.mana.zitare.reachability")
|
||||
private let log = Logger(subsystem: "ev.mana.zitare", category: "reachability")
|
||||
private var wasReachable: Bool? = nil
|
||||
private var onReconnect: @Sendable () -> Void = {}
|
||||
private let monitor = NWPathMonitor()
|
||||
private let queue = DispatchQueue(label: "ev.mana.zitare.reachability")
|
||||
private let log = Logger(subsystem: "ev.mana.zitare", category: "reachability")
|
||||
private var wasReachable: Bool?
|
||||
private var onReconnect: @Sendable () -> Void = {}
|
||||
|
||||
func start(onReconnect: @escaping @Sendable () -> Void) {
|
||||
self.onReconnect = onReconnect
|
||||
monitor.pathUpdateHandler = { [weak self] path in
|
||||
guard let self else { return }
|
||||
let reachable = path.status == .satisfied
|
||||
let prev = self.wasReachable
|
||||
self.wasReachable = reachable
|
||||
if prev == false, reachable {
|
||||
self.log.info("Reachable again — triggering reconnect-hook")
|
||||
self.onReconnect()
|
||||
} else if prev == nil {
|
||||
self.log.info("Initial reachability: \(reachable ? "yes" : "no", privacy: .public)")
|
||||
}
|
||||
}
|
||||
monitor.start(queue: queue)
|
||||
}
|
||||
func start(onReconnect: @escaping @Sendable () -> Void) {
|
||||
self.onReconnect = onReconnect
|
||||
monitor.pathUpdateHandler = { [weak self] path in
|
||||
guard let self else { return }
|
||||
let reachable = path.status == .satisfied
|
||||
let prev = self.wasReachable
|
||||
self.wasReachable = reachable
|
||||
if prev == false, reachable {
|
||||
self.log.info("Reachable again — triggering reconnect-hook")
|
||||
self.onReconnect()
|
||||
} else if prev == nil {
|
||||
self.log.info("Initial reachability: \(reachable ? "yes" : "no", privacy: .public)")
|
||||
}
|
||||
}
|
||||
monitor.start(queue: queue)
|
||||
}
|
||||
|
||||
func stop() {
|
||||
monitor.cancel()
|
||||
}
|
||||
func stop() {
|
||||
monitor.cancel()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue