Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run swiftlint --fix over the project #774

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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