Skip to content

Commit c25d82d

Browse files
fix: lint errors
1 parent 845b966 commit c25d82d

7 files changed

Lines changed: 16 additions & 17 deletions

File tree

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/EnterVerificationCodeView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ struct EnterVerificationCodeView: View {
9595
return NavigationStack {
9696
EnterVerificationCodeView(
9797
verificationID: "mock-id",
98-
fullPhoneNumber: "+1 5551234567",
98+
fullPhoneNumber: "+1 5551234567"
9999
)
100100
.environment(AuthService())
101101
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/PrivacyTOCsView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct PrivacyTOCsView {
3030

3131
let displayMode: DisplayMode
3232

33-
public init(displayMode: DisplayMode = .full) {
33+
init(displayMode: DisplayMode = .full) {
3434
self.displayMode = displayMode
3535
}
3636

@@ -61,7 +61,7 @@ struct PrivacyTOCsView {
6161
}
6262

6363
extension PrivacyTOCsView: View {
64-
public var body: some View {
64+
var body: some View {
6565
Group {
6666
if let tosURL = authService.configuration.tosUrl,
6767
let privacyURL = authService.configuration.privacyPolicyUrl {

FirebaseSwiftUI/FirebaseAuthSwiftUI/Tests/FirebaseAuthSwiftUITests/MFAEnrolmentUnitTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import Testing
2929
@Suite("TOTPEnrollmentInfo Tests")
3030
struct TOTPEnrollmentInfoTests {
3131
@Test("Initialization with shared secret key")
32-
func testInitializationWithSharedSecretKey() {
32+
func initializationWithSharedSecretKey() {
3333
let validSecrets = [
3434
"JBSWY3DPEHPK3PXP",
3535
"GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ",
@@ -47,7 +47,7 @@ struct TOTPEnrollmentInfoTests {
4747
}
4848

4949
@Test("Initialization with all parameters")
50-
func testInitializationWithAllParameters() throws {
50+
func initializationWithAllParameters() throws {
5151
let totpInfo = TOTPEnrollmentInfo(
5252
sharedSecretKey: "JBSWY3DPEHPK3PXP",
5353
qrCodeURL: URL(
@@ -71,7 +71,7 @@ struct TOTPEnrollmentInfoTests {
7171
}
7272

7373
@Test("Verification status transitions")
74-
func testVerificationStatusTransitions() {
74+
func verificationStatusTransitions() {
7575
// Default status is pending
7676
var totpInfo = TOTPEnrollmentInfo(sharedSecretKey: "JBSWY3DPEHPK3PXP")
7777
#expect(totpInfo.verificationStatus == .pending)

FirebaseSwiftUI/FirebaseAuthUIComponents/Sources/Components/AuthTextField.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ public struct AuthTextField<Leading: View>: View {
3535
let prompt: String
3636
var textAlignment: TextAlignment = .leading
3737
var keyboardType: UIKeyboardType = .default
38-
var contentType: UITextContentType? = nil
38+
var contentType: UITextContentType?
3939
var isSecureTextField: Bool = false
4040
var validations: [FieldValidation] = []
41-
var formState: ((Bool) -> Void)? = nil
42-
var onSubmit: ((String) -> Void)? = nil
43-
var onChange: ((String) -> Void)? = nil
41+
var formState: ((Bool) -> Void)?
42+
var onSubmit: ((String) -> Void)?
43+
var onChange: ((String) -> Void)?
4444
private let leading: () -> Leading?
4545

4646
public init(text: Binding<String>,

FirebaseSwiftUI/FirebaseAuthUIComponents/Sources/Components/CountrySelector.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public struct CountryData: Equatable {
4444
public struct CountrySelector: View {
4545
@Binding var selectedCountry: CountryData
4646
var enabled: Bool = true
47-
var allowedCountries: Set<String>? = nil
47+
var allowedCountries: Set<String>?
4848

4949
public init(selectedCountry: Binding<CountryData>,
5050
enabled: Bool = true,

FirebaseSwiftUI/FirebaseAuthUIComponents/Sources/Components/VerificationCodeInputField.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public struct VerificationCodeInputField: View {
116116
commitCodeChange(truncated)
117117
}
118118

119-
if shouldUpdateFocus && (fieldsChanged || forceFocus) {
119+
if shouldUpdateFocus, fieldsChanged || forceFocus {
120120
let newFocus = truncated.count < codeLength ? truncated.count : nil
121121
DispatchQueue.main.async {
122122
withAnimation(.easeInOut(duration: 0.2)) {
@@ -125,7 +125,7 @@ public struct VerificationCodeInputField: View {
125125
}
126126
}
127127

128-
if fieldsChanged && truncated.count == codeLength {
128+
if fieldsChanged, truncated.count == codeLength {
129129
DispatchQueue.main.async {
130130
onCodeComplete(truncated)
131131
}
@@ -169,8 +169,7 @@ public struct VerificationCodeInputField: View {
169169
commitCodeChange(newCode)
170170
onCodeChange(newCode)
171171

172-
if !digit.isEmpty,
173-
let nextIndex = findNextEmptyField(startingFrom: index) {
172+
if !digit.isEmpty, let nextIndex = findNextEmptyField(startingFrom: index) {
174173
DispatchQueue.main.async {
175174
if focusedIndex != nextIndex {
176175
withAnimation(.easeInOut(duration: 0.2)) {
@@ -189,7 +188,7 @@ public struct VerificationCodeInputField: View {
189188

190189
private func handleBackspace(at index: Int) {
191190
// If current field is empty, move to previous field and clear it
192-
if digitFields[index].isEmpty && index > 0 {
191+
if digitFields[index].isEmpty, index > 0 {
193192
digitFields[index - 1] = ""
194193
DispatchQueue.main.async {
195194
let previousIndex = index - 1

FirebaseSwiftUI/FirebaseAuthUIComponents/Sources/Theme/ProviderStyle.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public struct ProviderStyle: Sendable {
3131
public let icon: Image?
3232
public let backgroundColor: Color
3333
public let contentColor: Color
34-
public var iconTint: Color? = nil
34+
public var iconTint: Color?
3535
public let shape: AnyShape = .init(RoundedRectangle(cornerRadius: 4, style: .continuous))
3636
public let elevation: CGFloat
3737

0 commit comments

Comments
 (0)