Run swiftlint --fix over the project

This commit is contained in:
Blake McAnally 2024-07-09 20:03:40 -05:00
parent cd1b25e0c5
commit 964d08098b
9 changed files with 14 additions and 16 deletions

View file

@ -23,7 +23,7 @@ extension ExternalNotificationConfigEntity {
self.nagTimeout = Int32(config.nagTimeout)
self.useI2SAsBuzzer = config.useI2SAsBuzzer
}
func update(with config: ModuleConfig.ExternalNotificationConfig) {
enabled = config.enabled
usePWM = config.usePwm

View file

@ -559,7 +559,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
Logger.radio.debug("📟 \(log, privacy: .public)")
}
}
func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) {
if let error {
@ -600,8 +600,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
message = "DEBUG | \(message)"
}
handleRadioLog(radioLog: message)
}
catch {
} catch {
// Ignore fail to parse as LogRecord
}

View file

@ -8,8 +8,7 @@
import Foundation
import RegexBuilder
class CommonRegex
{
class CommonRegex {
static let COORDS_REGEX = Regex {
Capture {
Regex {

View file

@ -681,7 +681,7 @@ func telemetryPacket(packet: MeshPacket, connectedNode: Int64, context: NSManage
telemetry.snr = packet.rxSnr
telemetry.rssi = packet.rxRssi
telemetry.time = Date(timeIntervalSince1970: TimeInterval(Int64(truncatingIfNeeded: telemetryMessage.time)))
guard let mutableTelemetries = fetchedNode[0].telemetries!.mutableCopy() as? NSMutableOrderedSet else {
return
}

View file

@ -142,11 +142,11 @@ extension NSPersistentContainer {
/// - Parameter backupURL: A file URL containing backup copies of all currently loaded persistent stores.
/// - Throws: `CopyPersistentStoreError` in various situations.
/// - Returns: Nothing. If no errors are thrown, the restore is complete.
func restorePersistentStore(from backupURL: URL) throws -> Void {
func restorePersistentStore(from backupURL: URL) throws {
guard backupURL.isFileURL else {
throw CopyPersistentStoreErrors.invalidSource("Backup URL must be a file URL")
}
var isDirectory: ObjCBool = false
if FileManager.default.fileExists(atPath: backupURL.path, isDirectory: &isDirectory) {
if !isDirectory.boolValue {
@ -185,7 +185,7 @@ extension NSPersistentContainer {
/// - overwriting: If `true`, any existing copies of the persistent store will be replaced or updated. If `false`, existing copies will not be changed or remoted. When this is `false`, the destination persistent store file must not already exist.
/// - Throws: `CopyPersistentStoreError`
/// - Returns: Nothing. If no errors are thrown, all loaded persistent stores will be copied to the destination directory.
func copyPersistentStores(to destinationURL: URL, overwriting: Bool = false) throws -> Void {
func copyPersistentStores(to destinationURL: URL, overwriting: Bool = false) throws {
guard !destinationURL.relativeString.contains("/0/") else {
throw CopyPersistentStoreErrors.invalidDestination("Invalid 0 Node Id")

View file

@ -262,7 +262,7 @@ func upsertNodeInfoPacket (packet: MeshPacket, context: NSManagedObjectContext)
if fetchedNode[0].user == nil {
let newUser = createUser(num: Int64(truncatingIfNeeded: packet.from), context: context)
fetchedNode[0].user! = newUser
}
do {
try context.save()

View file

@ -76,7 +76,7 @@ struct MeshMapContent: MapContent {
}
}
}
.onTapGesture { location in
.onTapGesture { _ in
selectedPosition = (selectedPosition == position ? nil : position)
}
}

View file

@ -18,11 +18,11 @@ struct NodeDetail: View {
// The node the device is currently connected to
var connectedNode: NodeInfoEntity?
// The node information being displayed on the detail screen
@ObservedObject
var node: NodeInfoEntity
var columnVisibility = NavigationSplitViewVisibility.all
var favoriteNodeAction: some View {
@ -251,7 +251,7 @@ struct NodeDetail: View {
bleManager: bleManager,
node: node
)
if let connectedNode {
if node.isStoreForwardRouter {
ClientHistoryButton(

View file

@ -35,7 +35,7 @@ struct NodeList: View {
sortDescriptors: [
NSSortDescriptor(key: "favorite", ascending: false),
NSSortDescriptor(key: "lastHeard", ascending: false),
NSSortDescriptor(key: "user.longName", ascending: true),
NSSortDescriptor(key: "user.longName", ascending: true)
],
animation: .default
)