Skip to content
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
3 changes: 3 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ only_rules:
# Lines should not have trailing whitespace.
- trailing_whitespace

# Unused parameters in closures should be replaced with `_`.
- unused_closure_parameter

- custom_rules

# Rules configuration
Expand Down
2 changes: 1 addition & 1 deletion Sources/Experiments/ExPlatService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class ExPlatService {
request.setValue(userAgent, forHTTPHeaderField: "User-Agent")
}

let task = URLSession.shared.dataTask(with: request) { data, response, error in
let task = URLSession.shared.dataTask(with: request) { data, _, error in

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new PR stacked on top of this one to address this fix so we can keep the two separate and history is easier to track.

If possible, add a unit test to demonstrate the issue first, then apply the fix.

guard let data, error == nil else {
completion(nil)
return
Expand Down
4 changes: 2 additions & 2 deletions Tests/Tests/Event Logging/EventLoggingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ class EventLoggingTests: XCTestCase {
exp.expectedFulfillmentCount = uploadCount

let eventLogging = self.eventLogging(delegate: MockEventLoggingDelegate()
.withDidStartUploadingCallback { log in
.withDidStartUploadingCallback { _ in
XCTAssertFalse(isUploading, "Only one upload should be running at the same time")
isUploading = true
}
.withDidFinishUploadingCallback { log in
.withDidFinishUploadingCallback { _ in
XCTAssertTrue(isUploading, "Only one upload should be running at the same time")
isUploading = false
exp.fulfill()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class EventLoggingUploadManagerTests: XCTestCase {

let delegate = MockEventLoggingDelegate()
.withShouldUploadLogFilesValue(false)
.withUploadCancelledCallback { logFile in
.withUploadCancelledCallback { _ in
exp.fulfill()
}

Expand All @@ -87,7 +87,7 @@ class EventLoggingUploadManagerTests: XCTestCase {
exp.expectedFulfillmentCount = 2

let delegate = MockEventLoggingDelegate()
.withUploadFailedCallback { error, _ in
.withUploadFailedCallback { _, _ in
exp.fulfill()
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/Tests/TracksEventPersistenceServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class TracksEventPersistenceServiceTests: XCTestCase {
let context = contextManager.managedObjectContext
let service = TracksEventPersistenceService(managedObjectContext: context)

let uuids = (0 ..< 2002).map { index in
let uuids = (0 ..< 2002).map { _ in
UUID()
}

Expand Down Expand Up @@ -164,7 +164,7 @@ class TracksEventPersistenceServiceTests: XCTestCase {
let context = contextManager.managedObjectContext
let service = TracksEventPersistenceService(managedObjectContext: context)

let uuids = (0 ..< 2002).map { index in
let uuids = (0 ..< 2002).map { _ in
UUID()
}

Expand Down