Skip to content

Commit a4aea60

Browse files
committed
SwiftFormat pass
1 parent 072fd4b commit a4aea60

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+339
-238
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let package = Package(
1111
.library(name: "TextFile", targets: ["TextFile"])
1212
],
1313
dependencies: [
14-
.package(url: "https://github.com/orchetect/swift-testing-extensions", from: "0.3.0"),
14+
.package(url: "https://github.com/orchetect/swift-testing-extensions", from: "0.3.0")
1515
],
1616
targets: [
1717
.target(name: "TextFile"),

Sources/TextFile/API Evolution/API-0.2.0.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// API-0.2.0.swift
33
// swift-textfile • https://github.com/orchetect/swift-textfile
4-
// © 2018-2025 Steffan Andrews • Licensed under MIT License
4+
// © 2018-2026 Steffan Andrews • Licensed under MIT License
55
//
66

77
@available(*, renamed: "StringTableRepresentable")

Sources/TextFile/API Evolution/API-0.4.0.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
//
22
// API-0.4.0.swift
33
// swift-textfile • https://github.com/orchetect/swift-textfile
4-
// © 2018-2025 Steffan Andrews • Licensed under MIT License
4+
// © 2018-2026 Steffan Andrews • Licensed under MIT License
55
//
66

77
// @_documentation(visibility: internal)
8-
// @available(*, deprecated, message: "The `TextFile` namespace has been removed and the package has been renamed to `TextFile`. Use namespaced types directly as top-level types.")
8+
// @available(
9+
// *,
10+
// deprecated,
11+
// message: "The `TextFile` namespace has been removed as the package has been renamed to `TextFile`. Use types as top-level types."
12+
// )
913
// enum TextFile { }
1014

1115
@_documentation(visibility: internal)

Sources/TextFile/API Evolution/API-0.5.0.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// API-0.5.0.swift
33
// swift-textfile • https://github.com/orchetect/swift-textfile
4-
// © 2018-2025 Steffan Andrews • Licensed under MIT License
4+
// © 2018-2026 Steffan Andrews • Licensed under MIT License
55
//
66

77
extension StringTable {

Sources/TextFile/API Evolution/API-0.5.1.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// API-0.5.1.swift
33
// swift-textfile • https://github.com/orchetect/swift-textfile
4-
// © 2018-2025 Steffan Andrews • Licensed under MIT License
4+
// © 2018-2026 Steffan Andrews • Licensed under MIT License
55
//
66

77
#if canImport(Darwin)

Sources/TextFile/ByteOrderMark/ByteOrderMark.swift

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// ByteOrderMark.swift
33
// swift-textfile • https://github.com/orchetect/swift-textfile
4-
// © 2018-2025 Steffan Andrews • Licensed under MIT License
4+
// © 2018-2026 Steffan Andrews • Licensed under MIT License
55
//
66

77
#if canImport(Darwin)
@@ -49,23 +49,23 @@ extension ByteOrderMark: Sendable { }
4949
extension ByteOrderMark: CustomStringConvertible {
5050
public var description: String {
5151
switch self {
52-
case .utf8: return "UTF-8"
53-
case .utf16BigEndian: return "UTF-16 (BE)"
54-
case .utf16LittleEndian: return "UTF-16 (LE)"
55-
case .utf32BigEndian: return "UTF-32 (BE)"
56-
case .utf32LittleEndian: return "UTF-32 (LE)"
52+
case .utf8: "UTF-8"
53+
case .utf16BigEndian: "UTF-16 (BE)"
54+
case .utf16LittleEndian: "UTF-16 (LE)"
55+
case .utf32BigEndian: "UTF-32 (BE)"
56+
case .utf32LittleEndian: "UTF-32 (LE)"
5757
}
5858
}
5959
}
6060

6161
extension ByteOrderMark: CustomDebugStringConvertible {
6262
public var debugDescription: String {
6363
switch self {
64-
case .utf8: return "utf8"
65-
case .utf16BigEndian: return "utf16BigEndian"
66-
case .utf16LittleEndian: return "utf16LittleEndian"
67-
case .utf32BigEndian: return "utf32BigEndian"
68-
case .utf32LittleEndian: return "utf32LittleEndian"
64+
case .utf8: "utf8"
65+
case .utf16BigEndian: "utf16BigEndian"
66+
case .utf16LittleEndian: "utf16LittleEndian"
67+
case .utf32BigEndian: "utf32BigEndian"
68+
case .utf32LittleEndian: "utf32LittleEndian"
6969
}
7070
}
7171
}
@@ -76,22 +76,22 @@ extension ByteOrderMark {
7676
/// String containing the raw code points that correspond to the byte order mark.
7777
public var string: String {
7878
switch self {
79-
case .utf8: return "\u{EF}\u{BB}\u{BF}"
80-
case .utf16BigEndian: return "\u{FE}\u{FF}"
81-
case .utf16LittleEndian: return "\u{FF}\u{FE}"
82-
case .utf32BigEndian: return "\u{00}\u{00}\u{FE}\u{FF}"
83-
case .utf32LittleEndian: return "\u{FF}\u{FE}\u{00}\u{00}"
79+
case .utf8: "\u{EF}\u{BB}\u{BF}"
80+
case .utf16BigEndian: "\u{FE}\u{FF}"
81+
case .utf16LittleEndian: "\u{FF}\u{FE}"
82+
case .utf32BigEndian: "\u{00}\u{00}\u{FE}\u{FF}"
83+
case .utf32LittleEndian: "\u{FF}\u{FE}\u{00}\u{00}"
8484
}
8585
}
8686

8787
/// Byte array containing the raw code points that correspond to the byte order mark.
8888
public var bytes: [UInt8] {
8989
switch self {
90-
case .utf8: return [0xEF, 0xBB, 0xBF]
91-
case .utf16BigEndian: return [0xFE, 0xFF]
92-
case .utf16LittleEndian: return [0xFF, 0xFE]
93-
case .utf32BigEndian: return [0x00, 0x00, 0xFE, 0xFF]
94-
case .utf32LittleEndian: return [0xFF, 0xFE, 0x00, 0x00]
90+
case .utf8: [0xEF, 0xBB, 0xBF]
91+
case .utf16BigEndian: [0xFE, 0xFF]
92+
case .utf16LittleEndian: [0xFF, 0xFE]
93+
case .utf32BigEndian: [0x00, 0x00, 0xFE, 0xFF]
94+
case .utf32LittleEndian: [0xFF, 0xFE, 0x00, 0x00]
9595
}
9696
}
9797

Sources/TextFile/ByteOrderMark/DataProtocol+ByteOrderMark.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DataProtocol+ByteOrderMark.swift
33
// swift-textfile • https://github.com/orchetect/swift-textfile
4-
// © 2018-2025 Steffan Andrews • Licensed under MIT License
4+
// © 2018-2026 Steffan Andrews • Licensed under MIT License
55
//
66

77
#if canImport(Darwin)
@@ -14,7 +14,7 @@ extension DataProtocol {
1414
/// Returns the text encoding Byte Order Mark (BOM) found at the start of the data, if present.
1515
public var byteOrderMarkPrefix: ByteOrderMark? {
1616
for bom in ByteOrderMark.parseOrder {
17-
if self.starts(with: bom.bytes) { return bom }
17+
if starts(with: bom.bytes) { return bom }
1818
}
1919
return nil
2020
}

Sources/TextFile/ByteOrderMark/String.Encoding+ByteOrderMark.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// String.Encoding+ByteOrderMark.swift
33
// swift-textfile • https://github.com/orchetect/swift-textfile
4-
// © 2018-2025 Steffan Andrews • Licensed under MIT License
4+
// © 2018-2026 Steffan Andrews • Licensed under MIT License
55
//
66

77
#if canImport(Darwin)

Sources/TextFile/DelimitedTextFormat/DelimitedTextFormat+UTType.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DelimitedTextFormat+UTType.swift
33
// swift-textfile • https://github.com/orchetect/swift-textfile
4-
// © 2018-2025 Steffan Andrews • Licensed under MIT License
4+
// © 2018-2026 Steffan Andrews • Licensed under MIT License
55
//
66

77
#if canImport(UniformTypeIdentifiers)
@@ -14,9 +14,9 @@ extension DelimitedTextFormat {
1414
public var utType: UTType {
1515
switch self {
1616
case .csv:
17-
return .commaSeparatedText
17+
.commaSeparatedText
1818
case .tsv:
19-
return .tabSeparatedText
19+
.tabSeparatedText
2020
}
2121
}
2222

Sources/TextFile/DelimitedTextFormat/DelimitedTextFormat.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DelimitedTextFormat.swift
33
// swift-textfile • https://github.com/orchetect/swift-textfile
4-
// © 2018-2025 Steffan Andrews • Licensed under MIT License
4+
// © 2018-2026 Steffan Andrews • Licensed under MIT License
55
//
66

77
/// Delimited text formats.
@@ -27,8 +27,8 @@ extension DelimitedTextFormat {
2727
/// Returns the file extension used for the file format.
2828
public var fileExtension: String {
2929
switch self {
30-
case .csv: return "csv"
31-
case .tsv: return "tsv"
30+
case .csv: "csv"
31+
case .tsv: "tsv"
3232
}
3333
}
3434

0 commit comments

Comments
 (0)