Skip to content

Commit 6efa753

Browse files
authored
Investigate swiftformat on Linux CI (#14808)
1 parent 31cf4cb commit 6efa753

File tree

6 files changed

+11
-13
lines changed

6 files changed

+11
-13
lines changed

FirebaseAuth/Sources/Swift/User/User.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,8 @@ extension User: NSSecureCoding {}
10811081
anonymous: Bool) async throws -> User {
10821082
guard let accessToken = accessToken,
10831083
let refreshToken = refreshToken else {
1084-
throw AuthErrorUtils.invalidUserTokenError(message: "Invalid user token: accessToken or refreshToken is nil")
1084+
throw AuthErrorUtils
1085+
.invalidUserTokenError(message: "Invalid user token: accessToken or refreshToken is nil")
10851086
}
10861087
let tokenService = SecureTokenService(withRequestConfiguration: auth.requestConfiguration,
10871088
accessToken: accessToken,

FirebaseAuth/Tests/Unit/ActionCodeURLTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import XCTest
1818

1919
/// Unit tests for ActionCodeURL
2020
class ActionCodeURLTests: XCTestCase {
21-
2221
/// Tests parsing a valid URL with resetPassword mode.
2322
func testParseURL() {
2423
let urlString = "https://www.example.com?apiKey=API_KEY&mode=resetPassword&oobCode=OOB_CODE"

FirebaseFunctions/Sources/Callable+Codable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public extension Callable where Request: Sendable, Response: Sendable {
282282
// `StreamResponseProtocol`, we know the `Response` generic argument
283283
// is `StreamResponse<_, _>`.
284284
let responseJSON = switch response {
285-
case .message(let json), .result(let json): json
285+
case let .message(json), let .result(json): json
286286
}
287287
let response = try decoder.decode(Response.self, from: responseJSON)
288288
if response is StreamResponseProtocol {

FirebaseFunctions/Sources/Functions.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,8 @@ enum FunctionsConstants {
461461
options: HTTPSCallableOptions?,
462462
timeout: TimeInterval,
463463
context: FunctionsContext,
464-
completion: @escaping @MainActor (Result<HTTPSCallableResult, Error>) -> Void) {
464+
completion: @escaping @MainActor (Result<HTTPSCallableResult, Error>)
465+
-> Void) {
465466
let fetcher: GTMSessionFetcher
466467
do {
467468
fetcher = try makeFetcher(

FirebaseFunctions/Sources/HTTPSCallable.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ open class HTTPSCallable: NSObject {
7777
/// - completion: The block to call when the HTTPS request has completed.
7878
@objc(callWithObject:completion:) open func call(_ data: Any? = nil,
7979
completion: @escaping @MainActor (HTTPSCallableResult?,
80-
Error?) -> Void) {
80+
Error?)
81+
-> Void) {
8182
if #available(iOS 13, macCatalyst 13, macOS 10.15, tvOS 13, watchOS 7, *) {
8283
Task {
8384
do {

scripts/style.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,10 @@ s%^./%%
180180
needs_formatting=false
181181
for f in $files; do
182182
if [[ "${f: -6}" == '.swift' ]]; then
183-
if [[ "$system" == 'Darwin' ]]; then
184-
# Match output that says:
185-
# 1/1 files would have been formatted. (with --dryrun)
186-
# 1/1 files formatted. (without --dryrun)
187-
mint run swiftformat "${swift_options[@]}" "$f" 2>&1 | grep '^1/1 files' > /dev/null
188-
else
189-
false
190-
fi
183+
# Match output that says:
184+
# 1/1 files would have been formatted. (with --dryrun)
185+
# 1/1 files formatted. (without --dryrun)
186+
mint run swiftformat "${swift_options[@]}" "$f" 2>&1 | grep '^1/1 files' > /dev/null
191187
else
192188
"$clang_format_bin" "${clang_options[@]}" "$f" | grep "<replacement " > /dev/null
193189
fi

0 commit comments

Comments
 (0)