Skip to content

Commit 7ddabfe

Browse files
Kyle-Yejoey-gm
andauthored
Documentation - Typos & Consistency Fixes (#716)
Co-authored-by: Joey GM <[email protected]>
1 parent 7197d54 commit 7ddabfe

File tree

70 files changed

+103
-100
lines changed

Some content is hidden

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

70 files changed

+103
-100
lines changed

Sources/SwiftDocC/Benchmark/Metrics/TopicAnchorHash.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import Foundation
1212

1313
extension Benchmark {
14-
/// A anchor sections hash metric produced off the given documentation context.
14+
/// An anchor sections hash metric produced off the given documentation context.
1515
///
1616
/// Use this metric to verify that your code changes
1717
/// did not affect the anchor sections in the compiled documentation.

Sources/SwiftDocC/Checker/Checkers/NonInclusiveLanguageChecker.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public struct NonInclusiveLanguageChecker: Checker {
121121

122122
/// Checks for a term in text.
123123
///
124-
/// The regular expression created from the provided term is evaluated with the case insensitve flag.
124+
/// The regular expression created from the provided term is evaluated with the case insensitive flag.
125125
///
126126
/// - Parameters:
127127
/// - term: The term to look for.

Sources/SwiftDocC/Indexing/Navigator/NavigatorIndex.swift

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ public class NavigatorIndex {
6363
public enum Error: Swift.Error, DescribedError {
6464

6565
/// Missing bundle identifier.
66+
case missingBundleIdentifier
67+
68+
@available(*, deprecated, renamed: "missingBundleIdentifier")
6669
case missingBundleIndentifier
6770

6871
/// A RenderNode has no title and won't be indexed.
@@ -72,8 +75,8 @@ public class NavigatorIndex {
7275
case navigatorIndexIsNil
7376

7477
public var errorDescription: String {
75-
switch self {
76-
case .missingBundleIndentifier:
78+
switch self {
79+
case .missingBundleIdentifier, .missingBundleIndentifier:
7780
return "A navigator index requires a bundle identifier, which is missing."
7881
case .missingTitle:
7982
return "The page has no valid title available."
@@ -175,7 +178,7 @@ public class NavigatorIndex {
175178
let bundleIdentifier = bundleIdentifier ?? information.get(type: String.self, forKey: NavigatorIndex.bundleKey) ?? NavigatorIndex.UnknownBundleIdentifier
176179

177180
guard bundleIdentifier != NavigatorIndex.UnknownBundleIdentifier else {
178-
throw Error.missingBundleIndentifier
181+
throw Error.missingBundleIdentifier
179182
}
180183

181184
// Use `.fnv1` by default if no path hasher is set for compatibility reasons.
@@ -237,7 +240,7 @@ public class NavigatorIndex {
237240
- url: The URL pointing to the path from which the index should be read.
238241
- bundleIdentifier: The name of the bundle the index is referring to.
239242
- readNavigatorTree: Indicates if the init needs to read the navigator tree from the disk, if false, then `readNavigatorTree` needs to be called later. Default: `true`.
240-
- presentationIdentifier: Indicates if the index has an indentifier useful for presentation contexts.
243+
- presentationIdentifier: Indicates if the index has an identifier useful for presentation contexts.
241244

242245
- Throws: A `NavigatorIndex.Error` describing the nature of the problem.
243246

@@ -282,7 +285,7 @@ public class NavigatorIndex {
282285
self.availabilityIndex = AvailabilityIndex()
283286

284287
guard self.bundleIdentifier != NavigatorIndex.UnknownBundleIdentifier else {
285-
throw Error.missingBundleIndentifier
288+
throw Error.missingBundleIdentifier
286289
}
287290
}
288291

@@ -577,10 +580,10 @@ extension NavigatorIndex {
577580
/// A temporary list of pending references that are waiting for their parent to be indexed.
578581
private var pendingUncuratedReferences = Set<Identifier>()
579582

580-
/// A map with all nodes that are curated mutliple times in the tree and need to be processed at the very end.
583+
/// A map with all nodes that are curated multiple times in the tree and need to be processed at the very end.
581584
private var multiCurated = [Identifier: NavigatorTree.Node]()
582585

583-
/// A set with all nodes that are curated mutliple times, but still have to be visited.
586+
/// A set with all nodes that are curated multiple times, but still have to be visited.
584587
private var multiCuratedUnvisited = Set<Identifier>()
585588

586589
/// A set with all nodes that are curated.
@@ -747,7 +750,7 @@ extension NavigatorIndex {
747750
}
748751
}
749752

750-
// Sort the IDs so multiple entries with the same availiabilities
753+
// Sort the IDs so multiple entries with the same availabilities
751754
// will generate the same hash. In this way we can find them in the dictionary.
752755
entryIDs.sort()
753756

Sources/SwiftDocC/Indexing/Navigator/NavigatorTree.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public protocol Serializable: LMDBData, RawRepresentable where RawValue == Data
3131

3232
The object needs to be conforming to `Serializable` so it can be transformed to raw data and reconstructed back using the same one.
3333

34-
- Note: The `parentID` might be missing if the object is the root, but to avoid creating an exception on the the object structure, its id is set to 0.
34+
- Note: The `parentID` might be missing if the object is the root, but to avoid creating an exception on the object structure, its id is set to 0.
3535
*/
3636
public class NavigatorTree {
3737

@@ -225,7 +225,7 @@ public class NavigatorTree {
225225
queue.append(root)
226226

227227
var index: UInt32 = 0
228-
while index < queue.count {
228+
while index < queue.count {
229229
let node = queue[Int(index)]
230230
node.id = index
231231
numericIdentifierToNode[index] = node

Sources/SwiftDocC/Indexing/RenderNode+Relationships.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extension RenderNode {
2222

2323
switch kind {
2424
case .overview:
25-
for case let section as VolumeRenderSection in sections {
25+
for case let section as VolumeRenderSection in sections {
2626
let chapters = section.chapters
2727
for chapter in chapters {
2828
let name = chapter.name
@@ -67,7 +67,7 @@ extension RenderNode {
6767
*/
6868
public func projectFiles() -> DownloadReference? {
6969
// sampleDownload is provided by pages which are of type "sample code".
70-
// This section provides an action which includes a download referece.
70+
// This section provides an action which includes a download reference.
7171
if let sampleDownload = sampleDownload, case let RenderInlineContent.reference(identifier, _, _, _) = sampleDownload.action,
7272
let reference = references[identifier.identifier] {
7373
return reference as? DownloadReference

Sources/SwiftDocC/Infrastructure/Bundle Assets/DataAssetManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct DataAssetManager {
2929
var fuzzyKeyIndex = [String: String]()
3030

3131
/**
32-
Returns the data that is registered to an data asset with the specified trait collection.
32+
Returns the data that is registered to a data asset with the specified trait collection.
3333

3434
If no data is registered that exactly matches the trait collection, the data with the trait
3535
collection that best matches the requested trait collection is returned.

Sources/SwiftDocC/Infrastructure/Communication/Foundation/JSON.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ extension JSON {
7777

7878
subscript(key: Any) -> JSON? {
7979
get {
80-
if let array = self.array, let index = key as? Int, index < array.count {
80+
if let array = self.array, let index = key as? Int, index < array.count {
8181
return array[index]
8282
} else if let dic = self.dictionary, let key = key as? String, let obj = dic[key] {
8383
return obj

Sources/SwiftDocC/Infrastructure/CoverageDataEntry.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ extension CoverageDataEntry {
318318
context: context))
319319
case .structure, .extendedStructure:
320320
self = try .structure(
321-
memberStats: KindSpecificData.extractChildStats(
321+
memberStats: KindSpecificData.extractChildStats(
322322
documentationNode: documentationNode,
323323
context: context))
324324
case .protocol, .extendedProtocol:
@@ -464,7 +464,7 @@ extension CoverageDataEntry.KindSpecificData {
464464

465465
/// For cases that have an associated type `RatioStatistic`, the appropriate initializer for that case on `KindSpecificData`
466466
/// - Throws: If the instance does not represent a case with associated type `RatioStatistic`
467-
/// - Returns: An closure that accepts an instance of `RatioStatistic` and returns an instance of `KindSpecificData`
467+
/// - Returns: A closure that accepts an instance of `RatioStatistic` and returns an instance of `KindSpecificData`
468468
func associatedRatioStatisticInitializer() throws -> (RatioStatistic) -> CoverageDataEntry
469469
.KindSpecificData
470470
{
@@ -500,7 +500,7 @@ extension CoverageDataEntry.KindSpecificData {
500500

501501
/// For cases that have an associated type `[InstanceMemberType: RatioStatistic]`, the appropriate initializer for that case on `KindSpecificData`
502502
/// - Throws: If the instance does not represent a case with associated type `RatioStatistic`
503-
/// - Returns: An closure that accepts an instance of `[InstanceMemberType: RatioStatistic]` and returns an instance of `KindSpecificData`
503+
/// - Returns: A closure that accepts an instance of `[InstanceMemberType: RatioStatistic]` and returns an instance of `KindSpecificData`
504504
func associatedMemberStatisticsInitializer() throws -> ([InstanceMemberType: RatioStatistic]) -> CoverageDataEntry
505505
.KindSpecificData
506506
{

Sources/SwiftDocC/Infrastructure/Diagnostics/Diagnostic.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public struct Diagnostic {
4242
return summary
4343
}
4444

45-
/// Additional details that explain the the problem or issue to the end-user in plain language.
45+
/// Additional details that explain the problem or issue to the end-user in plain language.
4646
public var explanation: String?
4747

4848
@available(*, deprecated, renamed: "explanation")

Sources/SwiftDocC/Infrastructure/DocumentationContext.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public class DocumentationContext: DocumentationContextDataProviderDelegate {
258258

259259
/// The mapping of external symbol identifiers to known disambiguated symbol path components.
260260
///
261-
/// In situations where the the local documentation context doesn't contain all of the current module's
261+
/// In situations where the local documentation context doesn't contain all of the current module's
262262
/// symbols, for example when using a ``ConvertService`` with a partial symbol graph,
263263
/// the documentation context is otherwise unable to accurately detect a collision for a given symbol and correctly
264264
/// disambiguate its path components. This value can be used to inject already disambiguated symbol
@@ -435,7 +435,7 @@ public class DocumentationContext: DocumentationContextDataProviderDelegate {
435435
/// - Parameter moduleReference: The module reference to find the module name for.
436436
/// - Returns: The plain string name for the referenced module.
437437
func moduleName(forModuleReference moduleReference: ResolvedTopicReference) -> (displayName: String, symbolName: String) {
438-
if let name = moduleNameCache[moduleReference] {
438+
if let name = moduleNameCache[moduleReference] {
439439
return name
440440
}
441441
// If no name is found it's considered a programmer error; either that the names haven't been resolved yet
@@ -2543,7 +2543,7 @@ public class DocumentationContext: DocumentationContextDataProviderDelegate {
25432543

25442544
// MARK: - Relationship queries
25452545

2546-
/// Fetch the child nodes of a documentation node with the given `reference``, optionally filtering to only children of the given `kind`.
2546+
/// Fetch the child nodes of a documentation node with the given `reference`, optionally filtering to only children of the given `kind`.
25472547
///
25482548
/// - Parameters:
25492549
/// - reference: The reference of the node to fetch children for.
@@ -2669,7 +2669,7 @@ public class DocumentationContext: DocumentationContextDataProviderDelegate {
26692669
/// - Parameters:
26702670
/// - name: The name of the asset.
26712671
/// - parent: The topic where the asset is referenced.
2672-
/// - Returns: The data that's associated with a image asset if it was found, otherwise `nil`.
2672+
/// - Returns: The data that's associated with an image asset if it was found, otherwise `nil`.
26732673
public func resolveAsset(named name: String, in parent: ResolvedTopicReference, withType type: AssetType? = nil) -> DataAsset? {
26742674
let bundleIdentifier = parent.bundleIdentifier
26752675
return resolveAsset(named: name, bundleIdentifier: bundleIdentifier, withType: type)

0 commit comments

Comments
 (0)