Enable explicit_init lint rule and fix issues#3418
Conversation
NachoSoto
left a comment
There was a problem hiding this comment.
Thanks for doing this! 👏🏻
| self = .freeTrial | ||
| @unknown default: | ||
| Logger.appleWarning(Strings.storeKit.skunknown_payment_mode(String.init(describing: paymentMode))) | ||
| Logger.appleWarning(Strings.storeKit.skunknown_payment_mode(.init(describing: paymentMode))) |
There was a problem hiding this comment.
Can we do
| Logger.appleWarning(Strings.storeKit.skunknown_payment_mode(.init(describing: paymentMode))) | |
| Logger.appleWarning(Strings.storeKit.skunknown_payment_mode(paymentMode.rawValue)) |
That doesn't use reflection so it's a lot faster
There was a problem hiding this comment.
Sadly it's a UInt enum :(
There was a problem hiding this comment.
Then String(enum.rawValue). Describing uses runtime reflection and it's A LOT slower.
There was a problem hiding this comment.
You already merged so it's fine. It was already like this anyway.
There was a problem hiding this comment.
And it's not like this is a hot path.
| self = .freeTrial | ||
| default: | ||
| Logger.appleWarning(Strings.storeKit.skunknown_payment_mode(String.init(describing: paymentMode))) | ||
| Logger.appleWarning(Strings.storeKit.skunknown_payment_mode(.init(describing: paymentMode))) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3418 +/- ##
=======================================
Coverage 86.07% 86.07%
=======================================
Files 237 237
Lines 17201 17201
=======================================
Hits 14805 14805
Misses 2396 2396 ☔ View full report in Codecov by Sentry. |
**This is an automatic release.** ### RevenueCatUI * Paywalls: Fix navigation with close button in UIKit (#3466) via Andy Boedo (@aboedo) * `Paywalls`: `watchOS` support (#3291) via NachoSoto (@NachoSoto) ### Dependency Updates * Bump cocoapods from 1.14.2 to 1.14.3 (#3464) via dependabot[bot] (@dependabot[bot]) * Bump fastlane from 2.216.0 to 2.217.0 (#3415) via dependabot[bot] (@dependabot[bot]) * Bump danger from 9.3.2 to 9.4.0 (#3414) via dependabot[bot] (@dependabot[bot]) ### Other Changes * Some `APITester` fixes (#3444) via NachoSoto (@NachoSoto) * `HTTPClient`: test all request headers (#3425) via NachoSoto (@NachoSoto) * `CircleCI`: fix snapshot generation for iOS 14 (#3431) via NachoSoto (@NachoSoto) * Remove `MockStoreMessagesHelper` from SDK (#3417) via NachoSoto (@NachoSoto) * Enable explicit_init lint rule and fix issues (#3418) via Mark Villacampa (@MarkVillacampa)
This rule will warn when calling
initwith the explicit type where it can be inferred, or where the.initpart can be omitted.