Skip to content

Commit 973a1f2

Browse files
committed
Run swiftlint --fix
1 parent d88dc7c commit 973a1f2

File tree

52 files changed

+136
-161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+136
-161
lines changed

Sources/Pulse/Helpers/CoreData+Extensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extension NSManagedObjectContext {
1111
return try fetch(request)
1212
}
1313

14-
func fetch<T: NSManagedObject, Value>(_ entity: T.Type, sortedBy keyPath: KeyPath<T, Value>, ascending: Bool = true, _ configure: (NSFetchRequest<T>) -> Void = { _ in }) throws -> [T] {
14+
func fetch<T: NSManagedObject, Value>(_ entity: T.Type, sortedBy keyPath: KeyPath<T, Value>, ascending: Bool = true, _ configure: (NSFetchRequest<T>) -> Void = { _ in }) throws -> [T] {
1515
try fetch(entity) {
1616
$0.sortDescriptors = [NSSortDescriptor(keyPath: keyPath, ascending: ascending)]
1717
}

Sources/Pulse/Helpers/Regex.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ final class Regex {
1010
struct Options: OptionSet {
1111
let rawValue: Int
1212

13-
init(rawValue: Int) {
14-
self.rawValue = rawValue
15-
}
16-
1713
static let caseInsensitive = Options(rawValue: 1 << 0)
1814
static let multiline = Options(rawValue: 1 << 1)
1915
static let dotMatchesLineSeparators = Options(rawValue: 1 << 2)

Sources/Pulse/LoggerStore/LoggerStore+Configuration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extension LoggerStore {
3939
/// Opens store in a readonly mode. It won't perform sweeps and will
4040
/// disallow any other modifications.
4141
public static let readonly = Options(rawValue: 1 << 3)
42-
42+
4343
/// Logs are not persistent on the device storage and new log file is created on each app session.
4444
/// Core Data is configured with container type as `NSInMemoryStoreType
4545
///

Sources/Pulse/LoggerStore/LoggerStore+Event.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extension LoggerStore {
3535
self.function = function
3636
self.line = line
3737
}
38-
38+
3939
init(_ entity: LoggerMessageEntity) {
4040
self.createdAt = entity.createdAt
4141
self.label = entity.label
@@ -116,7 +116,7 @@ extension LoggerStore {
116116
self.label = label
117117
self.taskDescription = taskDescription
118118
}
119-
119+
120120
init(_ entity: NetworkTaskEntity) {
121121
self.taskId = entity.taskId
122122
self.taskType = NetworkLogger.TaskType(rawValue: entity.taskType) ?? .dataTask

Sources/Pulse/LoggerStore/LoggerStore+Info.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ extension LoggerStore.Info.AppInfo {
103103
}
104104

105105
private func getAppIcon() -> Data? {
106-
guard let icons = Bundle.main.infoDictionary?["CFBundleIcons"] as? [String:Any],
107-
let primaryIcons = icons["CFBundlePrimaryIcon"] as? [String:Any],
106+
guard let icons = Bundle.main.infoDictionary?["CFBundleIcons"] as? [String: Any],
107+
let primaryIcons = icons["CFBundlePrimaryIcon"] as? [String: Any],
108108
let files = primaryIcons["CFBundleIconFiles"] as? [String],
109109
let lastIcon = files.last,
110110
let image = PlatformImage(named: lastIcon),

Sources/Pulse/LoggerStore/LoggerStore+Model.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ extension LoggerStore {
9090

9191
response.properties = [
9292
Attribute(name: "statusCode", type: .integer16AttributeType),
93-
Attribute(name: "httpHeaders", type: .stringAttributeType),
93+
Attribute(name: "httpHeaders", type: .stringAttributeType)
9494
]
9595

9696
progress.properties = [

Sources/Pulse/LoggerStore/LoggerStore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ extension LoggerStore {
484484
entity.response = event.response.map(makeResponse)
485485
entity.rawMetadata = {
486486
guard let responseBody = event.responseBody,
487-
(responseContentType?.isImage ?? false),
487+
responseContentType?.isImage ?? false,
488488
let metadata = Graphics.makeMetadata(from: responseBody) else {
489489
return nil
490490
}

Sources/Pulse/NetworkLogger/NetworkLogger+Entities.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extension NetworkLogger {
3939
if request.httpShouldHandleCookies { insert(.httpShouldHandleCookies) }
4040
if request.httpShouldUsePipelining { insert(.httpShouldUsePipelining) }
4141
}
42-
42+
4343
init(_ entity: NetworkRequestEntity) {
4444
self = []
4545
if entity.allowsCellularAccess { insert(.allowsCellularAccess) }
@@ -58,7 +58,7 @@ extension NetworkLogger {
5858
self.timeout = urlRequest.timeoutInterval
5959
self.options = Options(urlRequest)
6060
}
61-
61+
6262
init(_ entity: NetworkRequestEntity) {
6363
self.url = entity.url.flatMap(URL.init)
6464
self.httpMethod = entity.httpMethod
@@ -87,7 +87,7 @@ extension NetworkLogger {
8787
self.statusCode = httpResponse?.statusCode
8888
self.headers = httpResponse?.allHeaderFields as? [String: String]
8989
}
90-
90+
9191
init(_ entity: NetworkResponseEntity) {
9292
self.statusCode = Int(entity.statusCode)
9393
self.headers = entity.headers
@@ -291,7 +291,7 @@ extension NetworkLogger {
291291
if metrics.isConstrained { insert(.isConstrained) }
292292
if metrics.isMultipath { insert(.isMultipath) }
293293
}
294-
294+
295295
init(_ entity: NetworkTransactionMetricsEntity) {
296296
self = []
297297
if entity.isProxyConnection { insert(.isProxyConnection) }
@@ -302,7 +302,7 @@ extension NetworkLogger {
302302
if entity.isMultipath { insert(.isMultipath) }
303303
}
304304
}
305-
305+
306306
init(_ entity: NetworkTransactionMetricsEntity) {
307307
self.request = NetworkLogger.Request(entity.request)
308308
self.response = entity.response.map(NetworkLogger.Response.init)

Sources/Pulse/NetworkLogger/URLSessionProxyDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public final class URLSessionProxyDelegate: NSObject, URLSessionTaskDelegate, UR
2929
#selector(URLSessionTaskDelegate.urlSession(_:task:didFinishCollecting:)),
3030
#selector(URLSessionTaskDelegate.urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)),
3131
#selector(URLSessionDownloadDelegate.urlSession(_:downloadTask:didFinishDownloadingTo:)),
32-
#selector(URLSessionDownloadDelegate.urlSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:)),
32+
#selector(URLSessionDownloadDelegate.urlSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:))
3333
]
3434
if #available(iOS 16.0, tvOS 16.0, macOS 13.0, watchOS 9.0, *) {
3535
self.interceptedSelectors.insert(

Sources/Pulse/RemoteLogger/RemoteLogger-Connection.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extension RemoteLogger {
3434
let isLogEnabled = UserDefaults.standard.bool(forKey: "com.github.kean.pulse.debug")
3535
self.log = isLogEnabled ? OSLog(subsystem: "com.github.kean.pulse", category: "RemoteLogger") : .disabled
3636
}
37-
37+
3838
func start(on queue: DispatchQueue) {
3939
connection.stateUpdateHandler = { [weak self] state in
4040
guard let self = self else { return }
@@ -126,7 +126,7 @@ extension RemoteLogger {
126126
}
127127
}
128128
}
129-
129+
130130
func send(code: UInt8, data: Data) {
131131
do {
132132
let data = try encode(code: code, body: data)
@@ -149,24 +149,24 @@ extension RemoteLogger {
149149
os_log("Failed to encode a packet: %{public}@", log: log, type: .error, "\(error)")
150150
}
151151
}
152-
152+
153153
func sendMessage<T: Encodable>(path: Path, entity: T, _ completion: ((Data?, Error?) -> Void)? = nil) {
154154
do {
155155
sendMessage(path: path, data: try JSONEncoder().encode(entity), completion)
156156
} catch {
157157
os_log("Failed to send a message: %{public}@", log: log, type: .error, "\(error)")
158158
}
159159
}
160-
160+
161161
func sendMessage(path: Path, data: Data? = nil, _ completion: ((Data?, Error?) -> Void)? = nil) {
162162
let message = Message(id: id, options: [], path: path, data: data ?? Data())
163-
163+
164164
if id == UInt32.max {
165165
id = 0
166166
} else {
167167
id += 1
168168
}
169-
169+
170170
if let completion = completion {
171171
let id = message.id
172172
handlers[message.id] = completion
@@ -176,7 +176,7 @@ extension RemoteLogger {
176176
}
177177
}
178178
}
179-
179+
180180
do {
181181
let data = try Message.encode(message)
182182
send(code: .message, data: data)
@@ -192,7 +192,7 @@ extension RemoteLogger {
192192
os_log("Failed to encode a response: %{public}@", log: log, type: .error, "\(error)")
193193
}
194194
}
195-
195+
196196
func sendResponse(for message: Message, data: Data) {
197197
let message = Message(id: message.id, options: [.response], path: message.path, data: data)
198198
do {
@@ -202,7 +202,7 @@ extension RemoteLogger {
202202
os_log("Failed to encode a response: %{public}@", log: log, type: .error, "\(error)")
203203
}
204204
}
205-
205+
206206
func cancel() {
207207
connection.cancel()
208208
}

0 commit comments

Comments
 (0)