Skip to content

Commit

Permalink
Refactor [v124] fix warnings + lower threshold (#18613)
Browse files Browse the repository at this point in the history
* Fix standard image identifiers warnings

* Remove unused variable + fix indentation

* Lower warnings threshold

* Fix tests warnings

* Lower warning threshold again

* Oups
  • Loading branch information
lmarceau authored Feb 7, 2024
1 parent b4d817e commit 5afe277
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public struct StandardImageIdentifiers {
public static let login = "loginLarge"
public static let logoFirefox = "logoFirefoxLarge"
public static let nightMode = "nightModeLarge"
public static let notificationDotFill = "notificationDotFillLarge"
public static let notificationDot = "notificationDotLarge"
public static let notificationDotFill = "notificationDotFillLarge"
public static let packaging = "packagingLarge"
public static let pageZoom = "pageZoomLarge"
public static let pin = "pinLarge"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ class MetadataParserHelper: TabEventHandler {
}

guard let dict = result as? [String: Any],
let pageURL = tab.url?.displayURL,
let pageMetadata = PageMetadata.fromDictionary(dict) else {
TabEvent.post(.pageMetadataNotAvailable, for: tab)
tab.pageMetadata = nil
return
let pageMetadata = PageMetadata.fromDictionary(dict) else {
TabEvent.post(.pageMetadataNotAvailable, for: tab)
tab.pageMetadata = nil
return
}

tab.pageMetadata = pageMetadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class DefaultThemeManagerTests: XCTestCase {
}

func test_sutInitializesWithExpectedRegisteredValues() {
let sut = createSubject(with: userDefaults)
_ = createSubject(with: userDefaults)
let expectedSystemResult = true
let expectedNightModeResult = NSNumber(value: false)
let expectedPrivateModeResult = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class HistoryPanelTests: XCTestCase {

private func createSubject() -> HistoryPanel {
let profile = MockProfile()
let tabManager = MockTabManager()
let subject = HistoryPanel(profile: profile)
trackForMemoryLeaks(subject)
return subject
Expand Down
4 changes: 2 additions & 2 deletions test-fixtures/generate-metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -e

BUILD_LOG_FILE="$1"
TYPE_LOG_FILE="$2"
THRESHOLD_UNIT_TEST=20
THRESHOLD_XCUITEST=20
THRESHOLD_UNIT_TEST=15
THRESHOLD_XCUITEST=15

WARNING_COUNT=$(grep -E -v "SourcePackages/checkouts" "$BUILD_LOG_FILE" | grep -E "(^|:)[0-9]+:[0-9]+:|warning:|ld: warning:|<unknown>:0: warning:|fatal|===" | uniq | wc -l)

Expand Down

0 comments on commit 5afe277

Please sign in to comment.