Skip to content

Investigate swiftformat on Linux CI #14808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 2, 2025
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: 2 additions & 1 deletion FirebaseAuth/Sources/Swift/User/User.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,8 @@ extension User: NSSecureCoding {}
anonymous: Bool) async throws -> User {
guard let accessToken = accessToken,
let refreshToken = refreshToken else {
throw AuthErrorUtils.invalidUserTokenError(message: "Invalid user token: accessToken or refreshToken is nil")
throw AuthErrorUtils
.invalidUserTokenError(message: "Invalid user token: accessToken or refreshToken is nil")
}
let tokenService = SecureTokenService(withRequestConfiguration: auth.requestConfiguration,
accessToken: accessToken,
Expand Down
1 change: 0 additions & 1 deletion FirebaseAuth/Tests/Unit/ActionCodeURLTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import XCTest

/// Unit tests for ActionCodeURL
class ActionCodeURLTests: XCTestCase {

/// Tests parsing a valid URL with resetPassword mode.
func testParseURL() {
let urlString = "https://www.example.com?apiKey=API_KEY&mode=resetPassword&oobCode=OOB_CODE"
Expand Down
2 changes: 1 addition & 1 deletion FirebaseFunctions/Sources/Callable+Codable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public extension Callable where Request: Sendable, Response: Sendable {
// `StreamResponseProtocol`, we know the `Response` generic argument
// is `StreamResponse<_, _>`.
let responseJSON = switch response {
case .message(let json), .result(let json): json
case let .message(json), let .result(json): json
}
let response = try decoder.decode(Response.self, from: responseJSON)
if response is StreamResponseProtocol {
Expand Down
3 changes: 2 additions & 1 deletion FirebaseFunctions/Sources/Functions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,8 @@ enum FunctionsConstants {
options: HTTPSCallableOptions?,
timeout: TimeInterval,
context: FunctionsContext,
completion: @escaping @MainActor (Result<HTTPSCallableResult, Error>) -> Void) {
completion: @escaping @MainActor (Result<HTTPSCallableResult, Error>)
-> Void) {
let fetcher: GTMSessionFetcher
do {
fetcher = try makeFetcher(
Expand Down
3 changes: 2 additions & 1 deletion FirebaseFunctions/Sources/HTTPSCallable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ open class HTTPSCallable: NSObject {
/// - completion: The block to call when the HTTPS request has completed.
@objc(callWithObject:completion:) open func call(_ data: Any? = nil,
completion: @escaping @MainActor (HTTPSCallableResult?,
Error?) -> Void) {
Error?)
-> Void) {
if #available(iOS 13, macCatalyst 13, macOS 10.15, tvOS 13, watchOS 7, *) {
Task {
do {
Expand Down
12 changes: 4 additions & 8 deletions scripts/style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,10 @@ s%^./%%
needs_formatting=false
for f in $files; do
if [[ "${f: -6}" == '.swift' ]]; then
if [[ "$system" == 'Darwin' ]]; then
# Match output that says:
# 1/1 files would have been formatted. (with --dryrun)
# 1/1 files formatted. (without --dryrun)
mint run swiftformat "${swift_options[@]}" "$f" 2>&1 | grep '^1/1 files' > /dev/null
else
false
fi
# Match output that says:
# 1/1 files would have been formatted. (with --dryrun)
# 1/1 files formatted. (without --dryrun)
mint run swiftformat "${swift_options[@]}" "$f" 2>&1 | grep '^1/1 files' > /dev/null
else
"$clang_format_bin" "${clang_options[@]}" "$f" | grep "<replacement " > /dev/null
fi
Expand Down
Loading