Skip to content

Commit 591ff41

Browse files
amartini51milseman
authored andcommitted
Move TODO and FIXME markers to normal comments.
When they appear in triple-slash comments, that makes them part of the actual documentation that gets published. Fixes <rdar://problem/79071171>.
1 parent 2bc160b commit 591ff41

File tree

3 files changed

+21
-32
lines changed

3 files changed

+21
-32
lines changed

Sources/System/FilePath/FilePath.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
/// let fd = try FileDescriptor.open(path, .writeOnly, options: .append)
2929
/// try fd.closeAfter { try fd.writeAll(message.utf8) }
3030
///
31-
/// TODO(docs): Section on all the new syntactic operations, lexical normalization, decomposition,
32-
/// components, etc.
33-
///
3431
/// File paths conform to the
3532
/// and <doc://com.apple.documentation/documentation/swift/equatable>
3633
/// and <doc://com.apple.documentation/documentation/swift/hashable> protocols
@@ -40,6 +37,9 @@
4037
/// However, the rules for path equivalence
4138
/// are file-system–specific and have additional considerations
4239
/// like case insensitivity, Unicode normalization, and symbolic links.
40+
///
41+
// TODO(docs): Section on all the new syntactic operations, lexical normalization, decomposition,
42+
// components, etc.
4343
// @available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
4444
public struct FilePath {
4545
internal var _storage: SystemString

Sources/System/FilePath/FilePathSyntax.swift

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ extension FilePath {
6464
/// path.starts(with: "/usr/bin/ls///") // true
6565
/// path.starts(with: "/us") // false
6666
///
67-
/// TODO(Windows docs): examples with roots, such as whether `\foo\bar`
68-
/// starts with `C:\foo`
69-
///
67+
// TODO(Windows docs): examples with roots, such as whether `\foo\bar`
68+
// starts with `C:\foo`
7069
public func starts(with other: FilePath) -> Bool {
7170
guard !other.isEmpty else { return true }
7271
return self.root == other.root && components.starts(
@@ -85,9 +84,8 @@ extension FilePath {
8584
/// path.ends(with: "/usr/bin/ls///") // true
8685
/// path.ends(with: "/ls") // false
8786
///
88-
/// TODO(Windows docs): examples with roots, such as whether `C:\foo\bar`
89-
/// ends with `C:bar`
90-
///
87+
// TODO(Windows docs): examples with roots, such as whether `C:\foo\bar`
88+
// ends with `C:bar`
9189
public func ends(with other: FilePath) -> Bool {
9290
if other.root != nil {
9391
// TODO: anything tricky here for Windows?
@@ -453,8 +451,7 @@ extension FilePath {
453451
/// path.removePrefix("/us") // false
454452
/// path.removePrefix("/usr/local") // true, path is "bin"
455453
///
456-
/// TODO(Windows docs): example with roots
457-
///
454+
// TODO(Windows docs): example with roots
458455
public mutating func removePrefix(_ prefix: FilePath) -> Bool {
459456
defer { _invariantCheck() }
460457
// FIXME: Should Windows have more nuanced semantics?
@@ -476,8 +473,7 @@ extension FilePath {
476473
/// }
477474
/// // path is "/tmp/foo/bar/../baz"
478475
///
479-
/// TODO(Windows docs): example with roots
480-
///
476+
// TODO(Windows docs): example with roots
481477
public mutating func append(_ component: __owned FilePath.Component) {
482478
defer { _invariantCheck() }
483479
_append(unchecked: component._slice)
@@ -492,8 +488,7 @@ extension FilePath {
492488
/// let otherPath: FilePath = "/bin/ls"
493489
/// path.append(otherPath.components) // path is "/usr/local/bin/ls"
494490
///
495-
/// TODO(Windows docs): example with roots
496-
///
491+
// TODO(Windows docs): example with roots
497492
public mutating func append<C: Collection>(
498493
_ components: __owned C
499494
) where C.Element == FilePath.Component {
@@ -513,9 +508,8 @@ extension FilePath {
513508
/// path.append("static/assets") // "/var/www/website/static/assets"
514509
/// path.append("/main.css") // "/var/www/website/static/assets/main.css"
515510
///
516-
/// TODO(Windows docs): example with roots, should we rephrase this "spurious
517-
/// roots"?
518-
///
511+
// TODO(Windows docs): example with roots, should we rephrase this "spurious
512+
// roots"?
519513
public mutating func append(_ other: __owned String) {
520514
defer { _invariantCheck() }
521515
guard !other.utf8.isEmpty else { return }
@@ -529,8 +523,7 @@ extension FilePath {
529523

530524
/// Non-mutating version of `append(_:Component)`.
531525
///
532-
/// TODO(Windows docs): example with roots
533-
///
526+
// TODO(Windows docs): example with roots
534527
public __consuming func appending(_ other: __owned Component) -> FilePath {
535528
var copy = self
536529
copy.append(other)
@@ -539,8 +532,7 @@ extension FilePath {
539532

540533
/// Non-mutating version of `append(_:C)`.
541534
///
542-
/// TODO(Windows docs): example with roots
543-
///
535+
// TODO(Windows docs): example with roots
544536
public __consuming func appending<C: Collection>(
545537
_ components: __owned C
546538
) -> FilePath where C.Element == FilePath.Component {
@@ -551,8 +543,7 @@ extension FilePath {
551543

552544
/// Non-mutating version of `append(_:String)`.
553545
///
554-
/// TODO(Windows docs): example with roots
555-
///
546+
// TODO(Windows docs): example with roots
556547
public __consuming func appending(_ other: __owned String) -> FilePath {
557548
var copy = self
558549
copy.append(other)
@@ -573,23 +564,21 @@ extension FilePath {
573564
/// path.push("dir/file.txt") // path is "/tmp/dir/file.txt"
574565
/// path.push("/bin") // path is "/bin"
575566
///
576-
/// TODO(Windows docs): examples and docs with roots, update/generalize doc
577-
/// comment
578-
///
567+
// TODO(Windows docs): examples and docs with roots, update/generalize doc
568+
// comment
579569
public mutating func push(_ other: __owned FilePath) {
580570
defer { _invariantCheck() }
581571
guard other.root == nil else {
582572
self = other
583573
return
584574
}
585-
/// FIXME: Windows drive-relative roots, etc?
575+
// FIXME: Windows drive-relative roots, etc?
586576
_append(unchecked: other._storage[...])
587577
}
588578

589579
/// Non-mutating version of `push()`
590580
///
591-
/// TODO(Windows docs): examples and docs with roots
592-
///
581+
// TODO(Windows docs): examples and docs with roots
593582
public __consuming func pushing(_ other: __owned FilePath) -> FilePath {
594583
var copy = self
595584
copy.push(other)

Sources/System/FilePath/FilePathWindows.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,15 @@ internal struct WindowsRootInfo {
156156
/// * Device disk: `\\.\C:\`, `\\?\C:\`
157157
/// * UNC: `\\server\e:\`, `\\?\UNC\server\e:\`
158158
///
159-
/// TODO: NT paths? Admin paths using `$`?
159+
// TODO: NT paths? Admin paths using `$`?
160160
case drive(Character)
161161

162162
/// A volume with a GUID in a non-traditional path
163163
///
164164
/// * UNC: `\\host\Volume{0000-...}\`, `\\.\UNC\host\Volume{0000-...}\`
165165
/// * Device roots: `\\.\Volume{0000-...}\`, `\\?\Volume{000-...}\`
166166
///
167-
/// TODO: GUID type?
167+
// TODO: GUID type?
168168
case guid(String)
169169

170170
// TODO: Legacy DOS devices, such as COM1?

0 commit comments

Comments
 (0)