Skip to content

Commit

Permalink
Run swift-format
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrandonw authored and github-actions[bot] committed Jul 8, 2024
1 parent dc6d151 commit f6c51fa
Show file tree
Hide file tree
Showing 7 changed files with 294 additions and 296 deletions.
2 changes: 1 addition & 1 deletion Sources/SnapshotTesting/Diffing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public struct Diffing<Value> {
public var diff: (Value, Value) -> (String, [XCTAttachment])?

/// Creates a new `Diffing` on `Value`.
///
///
/// - Parameters:
/// - toData: A function used to convert a value _to_ data.
/// - fromData: A function used to produce a value _from_ data.
Expand Down
20 changes: 10 additions & 10 deletions Sources/SnapshotTesting/SnapshotTestingConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public func withSnapshotTesting<R>(
public struct SnapshotTestingConfiguration: Sendable {
@_spi(Internals)
@TaskLocal public static var current: Self?

/// The diff tool use to print helpful test failure messages.
///
/// See ``DiffTool-swift.struct`` for more information.
Expand All @@ -79,15 +79,15 @@ public struct SnapshotTestingConfiguration: Sendable {
self.diffTool = diffTool
self.record = record
}

/// The record mode of the snapshot test.
///
/// There are 4 primary strategies for recording: ``Record-swift.struct/all``,
/// ``Record-swift.struct/missing``, ``Record-swift.struct/never`` and
/// ``Record-swift.struct/failed``
public struct Record: Equatable, Sendable {
private let storage: Storage

public init?(rawValue: String) {
switch rawValue {
case "all":
Expand All @@ -114,7 +114,7 @@ public struct SnapshotTestingConfiguration: Sendable {
/// Records only the snapshots that are missing from disk.
public static let missing = Self(storage: .missing)

/// Does not record any snapshots. If a snapshot is missing a test failure will be raised. This
/// Does not record any snapshots. If a snapshot is missing a test failure will be raised. This
/// option is appropriate when running tests on CI so that re-tries of tests do not
/// surprisingly pass after snapshots are unexpectedly generated.
public static let never = Self(storage: .never)
Expand All @@ -130,14 +130,14 @@ public struct SnapshotTestingConfiguration: Sendable {
case never
}
}

/// Describes the diff command used to diff two files on disk.
///
/// This type can be created with a closure that takes two arguments: the first argument is
/// is a file path to the currently recorded snapshot on disk, and the second argument is the
/// file path to a _failed_ snapshot that was recorded to a temporary location on disk. You can
/// use these two file paths to construct a command that can be used to compare the two files.
///
///
/// For example, to use ImageMagick's `compare` tool and pipe the result into Preview.app, you
/// could create the following `DiffTool`:
///
Expand Down Expand Up @@ -193,22 +193,22 @@ public struct SnapshotTestingConfiguration: Sendable {
}

@available(
iOS,
iOS,
deprecated: 9999,
message: "Use '.all' instead of 'true', and '.missing' instead of 'false'."
)
@available(
macOS,
macOS,
deprecated: 9999,
message: "Use '.all' instead of 'true', and '.missing' instead of 'false'."
)
@available(
tvOS,
tvOS,
deprecated: 9999,
message: "Use '.all' instead of 'true', and '.missing' instead of 'false'."
)
@available(
watchOS,
watchOS,
deprecated: 9999,
message: "Use '.all' instead of 'true', and '.missing' instead of 'false'."
)
Expand Down
2 changes: 1 addition & 1 deletion Sources/SnapshotTesting/SnapshotsTestTrait.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
)
)
}

/// Configure snapshot testing in a suite or test.
///
/// - Parameter configuration: The configuration to use.
Expand Down
Loading

0 comments on commit f6c51fa

Please sign in to comment.