Skip to content

Commit

Permalink
Merge pull request #774 from meshtastic/swiftlint-autocorrect
Browse files Browse the repository at this point in the history
Run `swiftlint --fix` over the project
  • Loading branch information
garthvh committed Jul 16, 2024
2 parents a14e78e + 4a89412 commit 6dcbe3f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions Meshtastic/Helpers/BLEManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -600,8 +600,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
message = "DEBUG | \(message)"
}
handleRadioLog(radioLog: message)
}
catch {
} catch {
// Ignore fail to parse as LogRecord
}

Expand Down
3 changes: 1 addition & 2 deletions Meshtastic/Helpers/CommonRegex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
import Foundation
import RegexBuilder

class CommonRegex
{
class CommonRegex {
static let COORDS_REGEX = Regex {
Capture {
Regex {
Expand Down
6 changes: 3 additions & 3 deletions Meshtastic/Persistence/Persistence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion Meshtastic/Persistence/UpdateCoreData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct MeshMapContent: MapContent {
}
}
}
.onTapGesture { location in
.onTapGesture { _ in
selectedPosition = (selectedPosition == position ? nil : position)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Meshtastic/Views/Nodes/NodeList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,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: .spring
)
Expand Down

0 comments on commit 6dcbe3f

Please sign in to comment.