Skip to content

Commit 2f4391a

Browse files
authored
Fix missing array code convention at Test files (#18)
1 parent c04e18f commit 2f4391a

File tree

78 files changed

+483
-421
lines changed

Some content is hidden

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

78 files changed

+483
-421
lines changed

Tests/SwiftDocCTests/Benchmark/TopicGraphHashTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class TopicGraphHashTests: XCTestCase {
116116
"doc://org.swift.docc.example/documentation/Test-Bundle/article",
117117
"doc://org.swift.docc.example/documentation/Test-Bundle/article2",
118118
"doc://com.external.testbundle/article",
119-
"doc://com.external.testbundle/article2"
119+
"doc://com.external.testbundle/article2",
120120
])
121121

122122
// Verify correct hierarchy under `MyKit` in the topic graph dump including external symbols.

Tests/SwiftDocCTests/Checker/Checkers/NonInclusiveLanguageCheckerTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func aBlackListedFunc() {
162162
(.hint, true),
163163
(.information, true),
164164
(.warning, false),
165-
(.error, false)
165+
(.error, false),
166166
]
167167

168168
// Create a test bundle with some non-inclusive content.

Tests/SwiftDocCTests/Converter/RenderNodeCodableTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class RenderNodeCodableTests: XCTestCase {
2121
var testVariantOverride = VariantOverride(
2222
traits: [.interfaceLanguage("objc")],
2323
patch: [
24-
.replace(pointer: JSONPointer(pathComponents: ["foo"]), encodableValue: "bar")
24+
.replace(pointer: JSONPointer(pathComponents: ["foo"]), encodableValue: "bar"),
2525
]
2626
)
2727

Tests/SwiftDocCTests/Converter/Rewriter/RenderNodeVariantOverridesApplierTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ class RenderNodeVariantOverridesApplierTests: XCTestCase {
4545
renderNode.primaryContentSections = [
4646
DeclarationsRenderSection(
4747
declarations: [
48-
DeclarationRenderSection(languages: nil, platforms: [], tokens: [])
48+
DeclarationRenderSection(languages: nil, platforms: [], tokens: []),
4949
]
50-
)
50+
),
5151
]
5252

5353
renderNode.addVariantOverride(
5454
pointerComponents: ["primaryContentSections", "0"],
5555
value: DeclarationsRenderSection(
5656
declarations: [
5757
DeclarationRenderSection(languages: nil, platforms: [], tokens: []),
58-
DeclarationRenderSection(languages: nil, platforms: [], tokens: [])
58+
DeclarationRenderSection(languages: nil, platforms: [], tokens: []),
5959
]
6060
)
6161
)
@@ -230,7 +230,7 @@ fileprivate extension RenderNode {
230230
.replace(
231231
pointer: JSONPointer(pathComponents: pointerComponents),
232232
value: AnyCodable(value)
233-
)
233+
),
234234
]
235235
)
236236
)

Tests/SwiftDocCTests/Converter/TopicRenderReferenceEncoderTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class TopicRenderReferenceEncoderTests: XCTestCase {
1616
func testRenderNodeSkipsReferences() throws {
1717
var node = RenderNode(identifier: .init(bundleIdentifier: "bundle", path: "/documentation/MyClass", sourceLanguage: .swift), kind: .article)
1818
node.references = [
19-
"reference1": TopicRenderReference(identifier: .init("reference1"), title: "myFunction", abstract: [], url: "/documentation/MyClass/myFunction", kind: .symbol, estimatedTime: nil)
19+
"reference1": TopicRenderReference(identifier: .init("reference1"), title: "myFunction", abstract: [], url: "/documentation/MyClass/myFunction", kind: .symbol, estimatedTime: nil),
2020
]
2121

2222
// Verify encoding references
@@ -53,7 +53,7 @@ class TopicRenderReferenceEncoderTests: XCTestCase {
5353
// Create a render node
5454
var node = RenderNode(identifier: .init(bundleIdentifier: "bundle", path: "/documentation/MyClass", sourceLanguage: .swift), kind: .article)
5555
node.references = [
56-
"reference1": TopicRenderReference(identifier: .init("reference1"), title: "myFunction", abstract: [], url: "/documentation/MyClass/myFunction", kind: .symbol, estimatedTime: nil)
56+
"reference1": TopicRenderReference(identifier: .init("reference1"), title: "myFunction", abstract: [], url: "/documentation/MyClass/myFunction", kind: .symbol, estimatedTime: nil),
5757
]
5858

5959
let encoder = RenderJSONEncoder.makeEncoder()

Tests/SwiftDocCTests/Coverage/CoverageDetailedOutputTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Symbol Name Kind Abstract?
4646
isCurated: false,
4747
hasCodeListing: false,
4848
availability: nil,
49-
kindSpecificData: .class(memberStats: [:]))
49+
kindSpecificData: .class(memberStats: [:])),
5050
]
5151

5252
let result = CoverageDataEntry.generateSummary(
@@ -91,7 +91,7 @@ MyDocumentedUncuratedClass | Class | true |
9191
isCurated: true,
9292
hasCodeListing: false,
9393
availability: nil,
94-
kindSpecificData: .instanceProperty)
94+
kindSpecificData: .instanceProperty),
9595
]
9696

9797
let result = CoverageDataEntry.generateSummary(

Tests/SwiftDocCTests/Coverage/CoverageSummaryTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Globals | (0/0) | (0/0) | (0/0)
5353
isCurated: false,
5454
hasCodeListing: false,
5555
availability: nil,
56-
kindSpecificData: .class(memberStats: [:]))
56+
kindSpecificData: .class(memberStats: [:])),
5757
]
5858

5959
let result = CoverageDataEntry.generateSummary(
@@ -94,7 +94,7 @@ Globals | (0/0) | (0/0) | (0/0)
9494
isCurated: true,
9595
hasCodeListing: false,
9696
availability: nil,
97-
kindSpecificData: .instanceProperty)
97+
kindSpecificData: .instanceProperty),
9898
]
9999

100100
let result = CoverageDataEntry.generateSummary(

Tests/SwiftDocCTests/Diagnostics/DiagnosticTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ fileprivate let diagnostics: [String: Diagnostic] = [
169169
```swift
170170
func bar() {}
171171
```
172-
""")
172+
"""),
173173
]
174174

175175
enum Diagnostics {

Tests/SwiftDocCTests/DocumentationService/ConvertService/ConvertServiceTests.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class ConvertServiceTests: XCTestCase {
258258
documentPathsToConvert: [],
259259
symbolGraphs: [symbolGraph],
260260
knownDisambiguatedSymbolPathComponents: [
261-
"s:5MyKit0A5ClassC10myFunctionyyF": ["MyClass-swift.class", "myFunction()"]
261+
"s:5MyKit0A5ClassC10myFunctionyyF": ["MyClass-swift.class", "myFunction()"],
262262
],
263263
markupFiles: [myFunctionExtensionData],
264264
miscResourceURLs: []
@@ -310,7 +310,7 @@ class ConvertServiceTests: XCTestCase {
310310
documentPathsToConvert: [],
311311
symbolGraphs: [symbolGraph],
312312
knownDisambiguatedSymbolPathComponents: [
313-
"s:5MyKit0A5ClassC10myFunctionyyF": ["MyClass-swift.class", "myFunction()"]
313+
"s:5MyKit0A5ClassC10myFunctionyyF": ["MyClass-swift.class", "myFunction()"],
314314
],
315315
markupFiles: [],
316316
miscResourceURLs: []
@@ -343,7 +343,7 @@ class ConvertServiceTests: XCTestCase {
343343
}
344344

345345
request.knownDisambiguatedSymbolPathComponents = [
346-
"s:5MyKit0A5ClassC10myFunctionyyF": ["MyClass-swift.class", "myFunction()-swift.type.method"]
346+
"s:5MyKit0A5ClassC10myFunctionyyF": ["MyClass-swift.class", "myFunction()-swift.type.method"],
347347
]
348348

349349
try processAndAssert(request: request) { message in
@@ -416,7 +416,7 @@ class ConvertServiceTests: XCTestCase {
416416
documentPathsToConvert: [],
417417
symbolGraphs: [symbolGraph],
418418
knownDisambiguatedSymbolPathComponents: [
419-
"s:5MyKit0A5ClassC10myFunctionyyF": ["MyClass-swift.class", "myFunction()"]
419+
"s:5MyKit0A5ClassC10myFunctionyyF": ["MyClass-swift.class", "myFunction()"],
420420
],
421421
markupFiles: [],
422422
miscResourceURLs: []
@@ -479,7 +479,7 @@ class ConvertServiceTests: XCTestCase {
479479
knownDisambiguatedSymbolPathComponents: [
480480
// Only provide a single path component when this USR should
481481
// produce two
482-
"s:5MyKit0A5ClassC10myFunctionyyF": ["MyClass-swift.class"]
482+
"s:5MyKit0A5ClassC10myFunctionyyF": ["MyClass-swift.class"],
483483
],
484484
markupFiles: [],
485485
miscResourceURLs: []
@@ -620,7 +620,7 @@ class ConvertServiceTests: XCTestCase {
620620
"/documentation/SideKit",
621621
"/documentation/SideKit/SideProtocol/func()-6ijsi",
622622
"/documentation/SideKit/SideClass/myFunction()",
623-
"/documentation/SideKit/SideProtocol"
623+
"/documentation/SideKit/SideProtocol",
624624
],
625625
includesRenderReferenceStore: false,
626626
for: request
@@ -644,7 +644,7 @@ class ConvertServiceTests: XCTestCase {
644644
try processAndAssertResponseContents(
645645
expectedRenderNodePaths: [
646646
"/documentation/Test-Bundle/article",
647-
"/documentation/MyKit/MyClass/myFunction()"
647+
"/documentation/MyKit/MyClass/myFunction()",
648648
],
649649
includesRenderReferenceStore: false,
650650
for: request
@@ -882,7 +882,7 @@ class ConvertServiceTests: XCTestCase {
882882
[
883883
// Articles:
884884
"/documentation/TechnologyX",
885-
"/documentation/TechnologyX/article"
885+
"/documentation/TechnologyX/article",
886886
]
887887
)
888888

@@ -1147,7 +1147,7 @@ class ConvertServiceTests: XCTestCase {
11471147
isActive: true,
11481148
overridingTitle: nil,
11491149
overridingTitleInlineContent: nil
1150-
)
1150+
),
11511151
]
11521152
)
11531153

Tests/SwiftDocCTests/Indexing/IndexingTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ class IndexingTests: XCTestCase {
145145
func testRenderBlockContentUnorderedList() {
146146
let list = RenderBlockContent.unorderedList(items: [
147147
.init(content: [
148-
.paragraph(inlineContent: [.text("Hello, ")])
148+
.paragraph(inlineContent: [.text("Hello, ")]),
149149
]),
150150
.init(content: [
151-
.paragraph(inlineContent: [.text("world!")])
151+
.paragraph(inlineContent: [.text("world!")]),
152152
]),
153153
])
154154
XCTAssertEqual([], list.headings)
@@ -170,10 +170,10 @@ class IndexingTests: XCTestCase {
170170
func testRenderBlockContentOrderedList() {
171171
let list = RenderBlockContent.orderedList(items: [
172172
.init(content: [
173-
.paragraph(inlineContent: [.text("Hello, ")])
173+
.paragraph(inlineContent: [.text("Hello, ")]),
174174
]),
175175
.init(content: [
176-
.paragraph(inlineContent: [.text("world!")])
176+
.paragraph(inlineContent: [.text("world!")]),
177177
]),
178178
])
179179
XCTAssertEqual([], list.headings)

Tests/SwiftDocCTests/Infrastructure/AnchorSectionTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class AnchorSectionTests: XCTestCase {
2222
// Verify the sub-sections of the article have been collected in the context
2323
[
2424
ResolvedTopicReference(bundleIdentifier: bundle.identifier, path: "/documentation/TechnologyX/Article", fragment: "Article-Sub-Section", sourceLanguage: .swift),
25-
ResolvedTopicReference(bundleIdentifier: bundle.identifier, path: "/documentation/TechnologyX/Article", fragment: "Article-Sub-Sub-Section", sourceLanguage: .swift)
25+
ResolvedTopicReference(bundleIdentifier: bundle.identifier, path: "/documentation/TechnologyX/Article", fragment: "Article-Sub-Sub-Section", sourceLanguage: .swift),
2626
]
2727
.forEach { sectionReference in
2828
XCTAssertTrue(context.nodeAnchorSections.keys.contains(sectionReference))
@@ -80,7 +80,7 @@ class AnchorSectionTests: XCTestCase {
8080
// Verify the sub-sections of the article have been collected in the context
8181
[
8282
ResolvedTopicReference(bundleIdentifier: bundle.identifier, path: "/documentation/CoolFramework/CoolClass", fragment: "Symbol-Sub-Section", sourceLanguage: .swift),
83-
ResolvedTopicReference(bundleIdentifier: bundle.identifier, path: "/documentation/CoolFramework/CoolClass", fragment: "Symbol-Sub-Sub-Section", sourceLanguage: .swift)
83+
ResolvedTopicReference(bundleIdentifier: bundle.identifier, path: "/documentation/CoolFramework/CoolClass", fragment: "Symbol-Sub-Sub-Section", sourceLanguage: .swift),
8484
]
8585
.forEach { sectionReference in
8686
XCTAssertTrue(context.nodeAnchorSections.keys.contains(sectionReference))
@@ -138,7 +138,7 @@ class AnchorSectionTests: XCTestCase {
138138
// Verify the sub-sections of the article have been collected in the context
139139
[
140140
ResolvedTopicReference(bundleIdentifier: bundle.identifier, path: "/documentation/CoolFramework", fragment: "Module-Sub-Section", sourceLanguage: .swift),
141-
ResolvedTopicReference(bundleIdentifier: bundle.identifier, path: "/documentation/CoolFramework", fragment: "Module-Sub-Sub-Section", sourceLanguage: .swift)
141+
ResolvedTopicReference(bundleIdentifier: bundle.identifier, path: "/documentation/CoolFramework", fragment: "Module-Sub-Sub-Section", sourceLanguage: .swift),
142142
]
143143
.forEach { sectionReference in
144144
XCTAssertTrue(context.nodeAnchorSections.keys.contains(sectionReference))

Tests/SwiftDocCTests/Infrastructure/AutomaticCurationTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class AutomaticCurationTests: XCTestCase {
7979
"doc://org.swift.docc.example/documentation/SideKit/SideClass/init()",
8080
"doc://org.swift.docc.example/documentation/SideKit/SideClass/myFunction()",
8181
"doc://org.swift.docc.example/documentation/SideKit/SideClass/path",
82-
"doc://org.swift.docc.example/documentation/SideKit/SideClass/url"
82+
"doc://org.swift.docc.example/documentation/SideKit/SideClass/url",
8383
]
8484

8585
// Curate one or two of the children at a time and leave the rest for automatic curation.
@@ -159,7 +159,7 @@ class AutomaticCurationTests: XCTestCase {
159159
let declarationFragments: [SymbolGraph.Symbol.DeclarationFragments.Fragment] = [
160160
.init(kind: .keyword, spelling: "class", preciseIdentifier: nil),
161161
.init(kind: .text, spelling: " ", preciseIdentifier: nil),
162-
.init(kind: .identifier, spelling: newClassName, preciseIdentifier: nil)
162+
.init(kind: .identifier, spelling: newClassName, preciseIdentifier: nil),
163163
]
164164
let declaration = try JSONDecoder().decode(SymbolGraph.Symbol.DeclarationFragments.self, from: JSONEncoder().encode(declarationFragments))
165165
duplicateSymbol.mixins[SymbolGraph.Symbol.DeclarationFragments.mixinKey] = declaration
@@ -253,7 +253,7 @@ class AutomaticCurationTests: XCTestCase {
253253
// The other symbols in the same topic section appear in this See Also section
254254
XCTAssertEqual(renderNode.seeAlsoSections.first?.identifiers, [
255255
"doc://org.swift.docc.example/documentation/SideKit/SideClassOne",
256-
"doc://org.swift.docc.example/documentation/SideKit/SideClassTwo"
256+
"doc://org.swift.docc.example/documentation/SideKit/SideClassTwo",
257257
])
258258
}
259259

@@ -266,7 +266,7 @@ class AutomaticCurationTests: XCTestCase {
266266
// The other symbols in the same topic section appear in this See Also section
267267
XCTAssertEqual(renderNode.seeAlsoSections.first?.identifiers, [
268268
"doc://org.swift.docc.example/documentation/SideKit/SideClassThree",
269-
"doc://org.swift.docc.example/documentation/SideKit/SideClassFive"
269+
"doc://org.swift.docc.example/documentation/SideKit/SideClassFive",
270270
])
271271
}
272272

Tests/SwiftDocCTests/Infrastructure/BundleDiscoveryTests.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class BundleDiscoveryTests: XCTestCase {
3434
Abstract.
3535
3636
Content.
37-
""")
37+
"""),
3838
])
3939
_ = try nestedBundle.write(inside: url)
4040
}
@@ -62,16 +62,16 @@ class BundleDiscoveryTests: XCTestCase {
6262
CopyOfFile(original: testBundleLocation),
6363
Folder(name: "nested", content: [
6464
Folder(name: "irrelevant", content: [
65-
TextFile(name: "irrelevant.txt", utf8Content: "distraction")
65+
TextFile(name: "irrelevant.txt", utf8Content: "distraction"),
6666
]),
6767
TextFile(name: "irrelevant.txt", utf8Content: "distraction"),
6868
Folder(name: "TestBundle2.docc", content: [
6969
InfoPlist(displayName: "Test Bundle", identifier: "com.example.bundle2"),
7070
Folder(name: "Subfolder", content: // All files flattened into one folder
7171
allFiles.map { CopyOfFile(original: $0) }
72-
)
73-
])
74-
])
72+
),
73+
]),
74+
]),
7575
])
7676

7777
let tempURL = Foundation.URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(ProcessInfo.processInfo.globallyUniqueString)
@@ -179,7 +179,7 @@ class BundleDiscoveryTests: XCTestCase {
179179
allFiles.filter { !$0.lastPathComponent.lowercased().hasSuffix(".symbols.json") }.map { CopyOfFile(original: $0) }
180180
),
181181
// The original Info.plist
182-
CopyOfFile(original: allFiles.first(where: { $0.lastPathComponent.lowercased() == "info.plist" })!)
182+
CopyOfFile(original: allFiles.first(where: { $0.lastPathComponent.lowercased() == "info.plist" })!),
183183
])
184184
)
185185

@@ -195,7 +195,7 @@ class BundleDiscoveryTests: XCTestCase {
195195
Folder(name: "Four", content: allFiles[30...].map { CopyOfFile(original: $0) })
196196
)
197197
)
198-
)
198+
),
199199
])
200200
)
201201
}
@@ -206,7 +206,7 @@ class BundleDiscoveryTests: XCTestCase {
206206
CopyOfFolder(original: testBundleLocation, filter: { !DocumentationBundleFileTypes.isSymbolGraphFile($0) }),
207207

208208
// Just the symbol graph files in a non-bundle folder
209-
CopyOfFolder(original: testBundleLocation, newName: "Not a doc bundle", filter: { DocumentationBundleFileTypes.isSymbolGraphFile($0) })
209+
CopyOfFolder(original: testBundleLocation, newName: "Not a doc bundle", filter: { DocumentationBundleFileTypes.isSymbolGraphFile($0) }),
210210
])
211211

212212
let tempURL = Foundation.URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(ProcessInfo.processInfo.globallyUniqueString)
@@ -223,7 +223,7 @@ class BundleDiscoveryTests: XCTestCase {
223223
additionalSymbolGraphFiles: [
224224
tempURL.appendingPathComponent("TestWorkspace/Not a doc bundle/mykit-iOS.symbols.json"),
225225
tempURL.appendingPathComponent("TestWorkspace/Not a doc bundle/sidekit.symbols.json"),
226-
tempURL.appendingPathComponent("TestWorkspace/Not a doc bundle/[email protected]")
226+
tempURL.appendingPathComponent("TestWorkspace/Not a doc bundle/[email protected]"),
227227
]
228228
)
229229
let bundles = try dataProvider.bundles(options: bundleDiscoveryOptions)
@@ -267,7 +267,7 @@ class BundleDiscoveryTests: XCTestCase {
267267
infoPlistFallbacks: [
268268
"CFBundleDisplayName": "Fallback Display Name",
269269
"CFBundleIdentifier": "com.fallback.bundle.identifier",
270-
"CFBundleVersion": "1.2.3"
270+
"CFBundleVersion": "1.2.3",
271271
],
272272
additionalSymbolGraphFiles: []
273273
)
@@ -315,7 +315,7 @@ class BundleDiscoveryTests: XCTestCase {
315315
"""),
316316
TextFile(name: "footer.html", utf8Content: """
317317
<footer><marquee>goodbye world</marquee></footer>
318-
""")
318+
"""),
319319
]
320320
)
321321

0 commit comments

Comments
 (0)