Skip to content

Commit

Permalink
Run swift-format
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis authored and github-actions[bot] committed Sep 23, 2024
1 parent 6cbc73b commit 27d767d
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 77 deletions.
152 changes: 76 additions & 76 deletions Sources/IssueReporting/Unimplemented.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,44 +74,44 @@ public func unimplemented<each Argument, Result>(
}

#if compiler(>=6)
/// Returns a throwing closure that reports an issue and throws a given error when invoked.
///
/// Useful for creating closures that need to be overridden by users of your API, and if it is
/// ever invoked without being overridden an issue will be reported. See
/// <doc:GettingStarted#Unimplemented-closures> for more information.
///
/// - Parameters:
/// - description: An optional description of the unimplemented closure.
/// - failure: The error thrown by the unimplemented closure.
/// - fileID: The fileID.
/// - filePath: The filePath.
/// - function: The function.
/// - line: The line.
/// - column: The column.
/// - Returns: A throwing closure that reports an issue and throws an error when invoked.
public func unimplemented<each Argument, Failure: Error, Result>(
_ description: @autoclosure @escaping @Sendable () -> String = "",
throwing failure: @autoclosure @escaping @Sendable () -> Failure,
fileID: StaticString = #fileID,
filePath: StaticString = #filePath,
function: StaticString = #function,
line: UInt = #line,
column: UInt = #column
) -> @Sendable (repeat each Argument) throws(Failure) -> Result {
return { (argument: repeat each Argument) throws(Failure) in
let description = description()
_fail(
description,
(repeat each argument),
fileID: fileID,
filePath: filePath,
function: function,
line: line,
column: column
)
throw failure()
/// Returns a throwing closure that reports an issue and throws a given error when invoked.
///
/// Useful for creating closures that need to be overridden by users of your API, and if it is
/// ever invoked without being overridden an issue will be reported. See
/// <doc:GettingStarted#Unimplemented-closures> for more information.
///
/// - Parameters:
/// - description: An optional description of the unimplemented closure.
/// - failure: The error thrown by the unimplemented closure.
/// - fileID: The fileID.
/// - filePath: The filePath.
/// - function: The function.
/// - line: The line.
/// - column: The column.
/// - Returns: A throwing closure that reports an issue and throws an error when invoked.
public func unimplemented<each Argument, Failure: Error, Result>(
_ description: @autoclosure @escaping @Sendable () -> String = "",
throwing failure: @autoclosure @escaping @Sendable () -> Failure,
fileID: StaticString = #fileID,
filePath: StaticString = #filePath,
function: StaticString = #function,
line: UInt = #line,
column: UInt = #column
) -> @Sendable (repeat each Argument) throws(Failure) -> Result {
return { (argument: repeat each Argument) throws(Failure) in
let description = description()
_fail(
description,
(repeat each argument),
fileID: fileID,
filePath: filePath,
function: function,
line: line,
column: column
)
throw failure()
}
}
}
#endif

/// Returns an asynchronous closure that reports an issue when invoked.
Expand Down Expand Up @@ -191,46 +191,46 @@ public func unimplemented<each Argument, Result>(
}

#if compiler(>=6)
/// Returns a throwing, asynchronous closure that reports an issue and throws a given error when
/// invoked.
///
/// Useful for creating closures that need to be overridden by users of your API, and if it is
/// ever invoked without being overridden an issue will be reported. See
/// <doc:GettingStarted#Unimplemented-closures> for more information.
///
/// - Parameters:
/// - description: An optional description of the unimplemented closure.
/// - failure: The error thrown by the unimplemented closure.
/// - fileID: The fileID.
/// - filePath: The filePath.
/// - function: The function.
/// - line: The line.
/// - column: The column.
/// - Returns: A throwing, asynchronous closure that reports an issue and throws an error when
/// invoked.
public func unimplemented<each Argument, Failure: Error, Result>(
_ description: @autoclosure @escaping @Sendable () -> String = "",
throwing failure: @autoclosure @escaping @Sendable () -> Failure,
fileID: StaticString = #fileID,
filePath: StaticString = #filePath,
function: StaticString = #function,
line: UInt = #line,
column: UInt = #column
) -> @Sendable (repeat each Argument) async throws(Failure) -> Result {
return { (argument: repeat each Argument) async throws(Failure) in
let description = description()
_fail(
description,
(repeat each argument),
fileID: fileID,
filePath: filePath,
function: function,
line: line,
column: column
)
throw failure()
/// Returns a throwing, asynchronous closure that reports an issue and throws a given error when
/// invoked.
///
/// Useful for creating closures that need to be overridden by users of your API, and if it is
/// ever invoked without being overridden an issue will be reported. See
/// <doc:GettingStarted#Unimplemented-closures> for more information.
///
/// - Parameters:
/// - description: An optional description of the unimplemented closure.
/// - failure: The error thrown by the unimplemented closure.
/// - fileID: The fileID.
/// - filePath: The filePath.
/// - function: The function.
/// - line: The line.
/// - column: The column.
/// - Returns: A throwing, asynchronous closure that reports an issue and throws an error when
/// invoked.
public func unimplemented<each Argument, Failure: Error, Result>(
_ description: @autoclosure @escaping @Sendable () -> String = "",
throwing failure: @autoclosure @escaping @Sendable () -> Failure,
fileID: StaticString = #fileID,
filePath: StaticString = #filePath,
function: StaticString = #function,
line: UInt = #line,
column: UInt = #column
) -> @Sendable (repeat each Argument) async throws(Failure) -> Result {
return { (argument: repeat each Argument) async throws(Failure) in
let description = description()
_fail(
description,
(repeat each argument),
fileID: fileID,
filePath: filePath,
function: function,
line: line,
column: column
)
throw failure()
}
}
}
#endif

@_disfavoredOverload
Expand Down
2 changes: 1 addition & 1 deletion Sources/IssueReporting/WithExpectedIssue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public func withExpectedIssue(
reportIssue(
"""
Asynchronously expecting failures is unavailable in XCTest.
Omit this test from your XCTest suite, or consider using Swift Testing, instead.
""",
fileID: fileID,
Expand Down

0 comments on commit 27d767d

Please sign in to comment.