Skip to content

Commit 87523ce

Browse files
bscothernaciidgh
authored andcommitted
Moved // FIXME: lines that broke doc comments to be above docs
1 parent 14e5e60 commit 87523ce

23 files changed

+101
-88
lines changed

Sources/Basic/DiagnosticsEngine.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ public func <<< <T>(
6767
return builder
6868
}
6969

70+
// FIXME: One thing we should consider is whether we should make the diagnostic
71+
// a protocol and put these properties on the type, which is conceptually the
72+
// right modeling, but might be cumbersome of our desired features don't
73+
// perfectly align with what the language can express.
74+
//
7075
/// A unique identifier for a diagnostic.
7176
///
7277
/// Diagnostic identifiers are intended to be a stable representation of a
@@ -76,12 +81,6 @@ public func <<< <T>(
7681
/// (e.g., a command line tool, an IDE, or a web UI) is expecting to receive
7782
/// diagnostics and be able to present additional UI affordances or workflows
7883
/// associated for specific kinds of diagnostics.
79-
///
80-
//
81-
// FIXME: One thing we should consider is whether we should make the diagnostic
82-
// a protocol and put these properties on the type, which is conceptually the
83-
// right modeling, but might be cumbersome of our desired features don't
84-
// perfectly align with what the language can express.
8584
public class DiagnosticID: ObjectIdentifierProtocol {
8685

8786
/// A piece of a diagnostic description.

Sources/Basic/FileSystem.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ public enum FileMode {
108108
}
109109
}
110110

111+
// FIXME: Design an asynchronous story?
112+
//
111113
/// Abstracted access to file system operations.
112114
///
113115
/// This protocol is used to allow most of the codebase to interact with a
114116
/// natural filesystem interface, while still allowing clients to transparently
115117
/// substitute a virtual file system or redirect file system operations.
116118
///
117119
/// NOTE: All of these APIs are synchronous and can block.
118-
//
119-
// FIXME: Design an asynchronous story?
120120
public protocol FileSystem: class {
121121
/// Check whether the given path exists and is accessible.
122122
func exists(_ path: AbsolutePath, followSymlink: Bool) -> Bool
@@ -133,10 +133,10 @@ public protocol FileSystem: class {
133133
/// Check whether the given path is accessible and is a symbolic link.
134134
func isSymlink(_ path: AbsolutePath) -> Bool
135135

136-
/// Get the contents of the given directory, in an undefined order.
137-
//
138136
// FIXME: Actual file system interfaces will allow more efficient access to
139137
// more data than just the name here.
138+
//
139+
/// Get the contents of the given directory, in an undefined order.
140140
func getDirectoryContents(_ path: AbsolutePath) throws -> [String]
141141

142142
/// Get the current working directory (similar to `getcwd(3)`), which can be
@@ -157,21 +157,21 @@ public protocol FileSystem: class {
157157
/// - recursive: If true, create missing parent directories if possible.
158158
func createDirectory(_ path: AbsolutePath, recursive: Bool) throws
159159

160+
// FIXME: This is obviously not a very efficient or flexible API.
161+
//
160162
/// Get the contents of a file.
161163
///
162164
/// - Returns: The file contents as bytes, or nil if missing.
163-
//
164-
// FIXME: This is obviously not a very efficient or flexible API.
165165
func readFileContents(_ path: AbsolutePath) throws -> ByteString
166166

167-
/// Write the contents of a file.
168-
//
169167
// FIXME: This is obviously not a very efficient or flexible API.
168+
//
169+
/// Write the contents of a file.
170170
func writeFileContents(_ path: AbsolutePath, bytes: ByteString) throws
171171

172-
/// Write the contents of a file.
173-
//
174172
// FIXME: This is obviously not a very efficient or flexible API.
173+
//
174+
/// Write the contents of a file.
175175
func writeFileContents(_ path: AbsolutePath, bytes: ByteString, atomically: Bool) throws
176176

177177
/// Recursively deletes the file system entity at `path`.
@@ -511,9 +511,9 @@ private class LocalFileSystem: FileSystem {
511511
}
512512
}
513513

514-
/// Concrete FileSystem implementation which simulates an empty disk.
515-
//
516514
// FIXME: This class does not yet support concurrent mutation safely.
515+
//
516+
/// Concrete FileSystem implementation which simulates an empty disk.
517517
public class InMemoryFileSystem: FileSystem {
518518
private class Node {
519519
/// The actual node data.

Sources/Basic/LazyCache.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
99
*/
1010

11+
// FIXME: This wrapper could benefit from local static variables, in which case
12+
// we could embed the cache object inside the accessor.
13+
//
1114
/// Thread-safe lazily cached methods.
1215
///
1316
/// The `lazy` annotation in Swift does not result in a thread-safe accessor,
@@ -25,9 +28,6 @@
2528
/// ```
2629
///
2730
/// See: https://bugs.swift.org/browse/SR-1042
28-
//
29-
// FIXME: This wrapper could benefit from local static variables, in which case
30-
// we could embed the cache object inside the accessor.
3131
public struct LazyCache<Class, T> {
3232
// FIXME: It would be nice to avoid a per-instance lock, but this type isn't
3333
// intended for creating large numbers of instances of. We also really want

Sources/Basic/OutputByteStream.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,10 @@ public struct Format {
537537
/// Inmemory implementation of OutputByteStream.
538538
public final class BufferedOutputByteStream: _OutputByteStreamBase {
539539

540-
/// Contents of the stream.
541540
// FIXME: For inmemory implementation we should be share this buffer with OutputByteStream.
542541
// One way to do this is by allowing OuputByteStream to install external buffers.
542+
//
543+
/// Contents of the stream.
543544
private var contents = [UInt8]()
544545

545546
override public init() {

Sources/Basic/Path.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,14 @@ public struct AbsolutePath: Hashable {
205205
return _impl.string
206206
}
207207

208+
// FIXME: We should investigate if it would be more efficient to instead
209+
// return a path component iterator that does all its work lazily, moving
210+
// from one path separator to the next on-demand.
211+
//
208212
/// Returns an array of strings that make up the path components of the
209213
/// absolute path. This is the same sequence of strings as the basenames
210214
/// of each successive path component, starting from the root. Therefore
211215
/// the first path component of an absolute path is always `/`.
212-
// FIXME: We should investigate if it would be more efficient to instead
213-
// return a path component iterator that does all its work lazily, moving
214-
// from one path separator to the next on-demand.
215216
public var components: [String] {
216217
// FIXME: This isn't particularly efficient; needs optimization, and
217218
// in fact, it might well be best to return a custom iterator so we
@@ -292,14 +293,15 @@ public struct RelativePath: Hashable {
292293
return _impl.string
293294
}
294295

296+
// FIXME: We should investigate if it would be more efficient to instead
297+
// return a path component iterator that does all its work lazily, moving
298+
// from one path separator to the next on-demand.
299+
//
295300
/// Returns an array of strings that make up the path components of the
296301
/// relative path. This is the same sequence of strings as the basenames
297302
/// of each successive path component. Therefore the returned array of
298303
/// path components is never empty; even an empty path has a single path
299304
/// component: the `.` string.
300-
// FIXME: We should investigate if it would be more efficient to instead
301-
// return a path component iterator that does all its work lazily, moving
302-
// from one path separator to the next on-demand.
303305
public var components: [String] {
304306
// FIXME: This isn't particularly efficient; needs optimization, and
305307
// in fact, it might well be best to return a custom iterator so we

Sources/Basic/TemporaryFile.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ public enum TempFileError: Swift.Error {
1717
/// Could not create a unique temporary filename.
1818
case couldNotCreateUniqueName
1919

20-
/// Some error thrown defined by posix's open().
2120
// FIXME: This should be factored out into a open error enum.
21+
//
22+
/// Some error thrown defined by posix's open().
2223
case other(Int32)
2324

2425
/// Couldn't find a temporary directory.
@@ -131,9 +132,9 @@ extension TemporaryFile: CustomStringConvertible {
131132
}
132133
}
133134

134-
/// Contains the error which can be thrown while creating a directory using POSIX's mkdir.
135-
//
136135
// FIXME: This isn't right place to declare this, probably POSIX or merge with FileSystemError?
136+
//
137+
/// Contains the error which can be thrown while creating a directory using POSIX's mkdir.
137138
public enum MakeDirectoryError: Swift.Error {
138139
/// The given path already exists as a directory, file or symbolic link.
139140
case pathExists

Sources/Build/BuildPlan.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ import func POSIX.getenv
1717

1818
public struct BuildParameters {
1919

20-
/// Path to the module cache directory to use for SwiftPM's own tests.
2120
// FIXME: Error handling.
21+
//
22+
/// Path to the module cache directory to use for SwiftPM's own tests.
2223
public static let swiftpmTestCache = resolveSymlinks(try! determineTempDirectory()).appending(component: "org.swift.swiftpm.tests-3")
2324

2425
/// Returns the directory to be used for module cache.

Sources/PackageDescription4/JSON.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ enum JSON {
2020
}
2121

2222
extension JSON {
23-
/// Converts the JSON to string representation.
2423
// FIXME: No escaping implemented for now.
24+
//
25+
/// Converts the JSON to string representation.
2526
func toString() -> String {
2627
switch self {
2728
case .null:

Sources/PackageGraph/DependencyResolver.swift

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ public protocol PackageContainer {
226226
/// if the previous one did not satisfy all constraints.
227227
func versions(filter isIncluded: (Version) -> Bool) -> AnySequence<Version>
228228

229+
// FIXME: We should perhaps define some particularly useful error codes
230+
// here, so the resolver can handle errors more meaningfully.
231+
//
229232
/// Fetch the declared dependencies for a particular version.
230233
///
231234
/// This property is expected to be efficient to access, and cached by the
@@ -234,9 +237,6 @@ public protocol PackageContainer {
234237
/// - Precondition: `versions.contains(version)`
235238
/// - Throws: If the version could not be resolved; this will abort
236239
/// dependency resolution completely.
237-
//
238-
// FIXME: We should perhaps define some particularly useful error codes
239-
// here, so the resolver can handle errors more meaningfully.
240240
func getDependencies(at version: Version) throws -> [PackageContainerConstraint<Identifier>]
241241

242242
/// Fetch the declared dependencies for a particular revision.
@@ -330,9 +330,9 @@ public protocol DependencyResolverDelegate {
330330
associatedtype Identifier: PackageContainerIdentifier
331331
}
332332

333-
/// A bound version for a package within an assignment.
334-
//
335333
// FIXME: This should be nested, but cannot be currently.
334+
//
335+
/// A bound version for a package within an assignment.
336336
public enum BoundVersion: Equatable, CustomStringConvertible {
337337
/// The assignment should not include the package.
338338
///
@@ -364,16 +364,16 @@ public enum BoundVersion: Equatable, CustomStringConvertible {
364364
}
365365
}
366366

367+
// FIXME: Maybe each package should just return this, instead of a list of
368+
// `PackageContainerConstraint`s. That won't work if we decide this should
369+
// eventually map based on the `Container` rather than the `Identifier`, though,
370+
// so they are separate for now.
371+
//
367372
/// A container for constraints for a set of packages.
368373
///
369374
/// This data structure is only designed to represent satisfiable constraint
370375
/// sets, it cannot represent sets including containers which have an empty
371376
/// constraint.
372-
//
373-
// FIXME: Maybe each package should just return this, instead of a list of
374-
// `PackageContainerConstraint`s. That won't work if we decide this should
375-
// eventually map based on the `Container` rather than the `Identifier`, though,
376-
// so they are separate for now.
377377
public struct PackageContainerConstraintSet<C: PackageContainer>: Collection, Hashable {
378378
public typealias Container = C
379379
public typealias Identifier = Container.Identifier
@@ -513,6 +513,8 @@ public struct PackageContainerConstraintSet<C: PackageContainer>: Collection, Ha
513513
}
514514
}
515515

516+
// FIXME: Actually make efficient.
517+
//
516518
/// A container for version assignments for a set of packages, exposed as a
517519
/// sequence of `Container` to `BoundVersion` bindings.
518520
///
@@ -524,16 +526,14 @@ public struct PackageContainerConstraintSet<C: PackageContainer>: Collection, Ha
524526
/// The set itself is designed to only ever contain a consistent set of
525527
/// assignments, i.e. each assignment should satisfy the induced
526528
/// `constraints`, but this invariant is not explicitly enforced.
527-
//
528-
// FIXME: Actually make efficient.
529529
struct VersionAssignmentSet<C: PackageContainer>: Equatable, Sequence {
530530
typealias Container = C
531531
typealias Identifier = Container.Identifier
532532

533-
/// The assignment records.
534-
//
535533
// FIXME: Does it really make sense to key on the identifier here. Should we
536534
// require referential equality of containers and use that to simplify?
535+
//
536+
/// The assignment records.
537537
fileprivate var assignments: OrderedDictionary<Identifier, (container: Container, binding: BoundVersion)>
538538

539539
/// Create an empty assignment.
@@ -596,15 +596,15 @@ struct VersionAssignmentSet<C: PackageContainer>: Equatable, Sequence {
596596
return result
597597
}
598598

599+
// FIXME: We need to cache this.
600+
//
599601
/// The combined version constraints induced by the assignment.
600602
///
601603
/// This consists of the merged constraints which need to be satisfied on
602604
/// each package as a result of the versions selected in the assignment.
603605
///
604606
/// The resulting constraint set is guaranteed to be non-empty for each
605607
/// mapping, assuming the invariants on the set are followed.
606-
//
607-
// FIXME: We need to cache this.
608608
var constraints: PackageContainerConstraintSet<Container> {
609609
// Collect all of the constraints.
610610
var result = PackageContainerConstraintSet<Container>()
@@ -643,9 +643,9 @@ struct VersionAssignmentSet<C: PackageContainer>: Equatable, Sequence {
643643
return result
644644
}
645645

646-
/// Check if the given `binding` for `container` is valid within the assignment.
647-
//
648646
// FIXME: This is currently very inefficient.
647+
//
648+
/// Check if the given `binding` for `container` is valid within the assignment.
649649
func isValid(binding: BoundVersion, for container: Container) -> Bool {
650650
switch binding {
651651
case .excluded:
@@ -820,8 +820,9 @@ public class DependencyResolver<
820820
/// Skip updating containers while fetching them.
821821
private let skipUpdate: Bool
822822

823-
/// Contains any error encountered during dependency resolution.
824823
// FIXME: @testable private
824+
//
825+
/// Contains any error encountered during dependency resolution.
825826
var error: Swift.Error?
826827

827828
/// Key used to cache a resolved subtree.
@@ -969,6 +970,11 @@ public class DependencyResolver<
969970
return assignment
970971
}
971972

973+
// FIXME: This needs to a way to return information on the failure, or we
974+
// will need to have it call the delegate directly.
975+
//
976+
// FIXME: @testable private
977+
//
972978
/// Resolve an individual container dependency tree.
973979
///
974980
/// This is the primary method in our bottom-up algorithm for resolving
@@ -983,11 +989,6 @@ public class DependencyResolver<
983989
/// - constraints: The external constraints which must be honored by the solution.
984990
/// - exclusions: The list of individually excluded package versions.
985991
/// - Returns: A sequence of feasible solutions, starting with the most preferable.
986-
//
987-
// FIXME: This needs to a way to return information on the failure, or we
988-
// will need to have it call the delegate directly.
989-
//
990-
// FIXME: @testable private
991992
func resolveSubtree(
992993
_ container: Container,
993994
subjectTo allConstraints: ConstraintSet,

Sources/PackageGraph/PackageGraphRoot.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ public struct PackageGraphRootInput {
3535
/// Represents the inputs to the package graph.
3636
public struct PackageGraphRoot {
3737

38-
/// Represents a top level package dependencies.
3938
// FIXME: We can kill this now.
39+
//
40+
/// Represents a top level package dependencies.
4041
public struct PackageDependency {
4142

4243
public typealias Requirement = PackageModel.PackageDependencyDescription.Requirement

Sources/PackageLoading/ManifestLoader.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@ private func sandboxProfile() -> String {
431431
return stream.bytes.asString!
432432
}
433433

434-
/// Represents a string error.
435434
// FIXME: We should probably just remove this and make all Manifest errors Codable.
435+
/// Represents a string error.
436436
struct StringError: Equatable, Codable, CustomStringConvertible, Error {
437437

438438
/// The description of the error.
@@ -521,8 +521,8 @@ final class ManifestLoadRule: LLBuildRule {
521521
}
522522
}
523523

524-
/// A rule to get file info of a file on disk.
525524
// FIXME: Find a proper place for this rule.
525+
/// A rule to get file info of a file on disk.
526526
final class FileInfoRule: LLBuildRule {
527527

528528
struct RuleKey: LLBuildKey {
@@ -564,10 +564,10 @@ final class FileInfoRule: LLBuildRule {
564564
}
565565
}
566566

567+
// FIXME: Find a proper place for this rule.
567568
/// A rule to compute the current version of the pacakge manager.
568569
///
569570
/// This rule will always run.
570-
// FIXME: Find a proper place for this rule.
571571
final class SwiftPMVersionRule: LLBuildRule {
572572

573573
struct RuleKey: LLBuildKey {

0 commit comments

Comments
 (0)