From e7ee72539f00bb27739ad812804fb54fd6f27a1c Mon Sep 17 00:00:00 2001 From: Marius Felkner Date: Mon, 17 Jun 2024 13:06:21 +0200 Subject: [PATCH] change: use docc linking --- Sources/Helper/VersionCompareResult.swift | 4 ++-- .../BuildMetaData/BuildMetaData.swift | 2 +- .../SemanticVersionComparable+Comparable.swift | 2 +- .../SemanticVersionComparable+Equatable.swift | 4 ++-- .../SemanticVersionComparable+Hashable.swift | 2 +- .../SemanticVersionComparable.swift | 12 ++++++------ Sources/Version+Bundle.swift | 4 ++-- Sources/Version+OS.swift | 2 +- Sources/Version+StringInitializer.swift | 6 +++--- Sources/Version.swift | 18 +++++++++--------- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Sources/Helper/VersionCompareResult.swift b/Sources/Helper/VersionCompareResult.swift index 36f24ee..0c3ac3d 100644 --- a/Sources/Helper/VersionCompareResult.swift +++ b/Sources/Helper/VersionCompareResult.swift @@ -6,8 +6,8 @@ // /// The severity of an update between versions. -/// -/// - Note: A difference between build-meta-data of versions are as `SemVer` states explicitly ignored. +/// +/// - Note: A difference between ``BuildMetaData`` of versions are as `SemVer` states explicitly ignored. public enum VersionCompareResult { /// A `MAJOR`update case major diff --git a/Sources/SemanticVersionComparable/BuildMetaData/BuildMetaData.swift b/Sources/SemanticVersionComparable/BuildMetaData/BuildMetaData.swift index 88e0389..6de88e4 100644 --- a/Sources/SemanticVersionComparable/BuildMetaData/BuildMetaData.swift +++ b/Sources/SemanticVersionComparable/BuildMetaData/BuildMetaData.swift @@ -5,7 +5,7 @@ // Created by Marius Felkner on 12.03.21. // -/// Enumerated build-meta-data for simple and `SemVer` conform access. +/// Enumerated ``BuildMetaData`` for simple and `SemVer` conform access. /// /// - Note: Identifier can be described using alphanumeric letters or digits. /// diff --git a/Sources/SemanticVersionComparable/SemanticVersionComparable+Comparable.swift b/Sources/SemanticVersionComparable/SemanticVersionComparable+Comparable.swift index b723541..08b02b7 100644 --- a/Sources/SemanticVersionComparable/SemanticVersionComparable+Comparable.swift +++ b/Sources/SemanticVersionComparable/SemanticVersionComparable+Comparable.swift @@ -8,7 +8,7 @@ public extension SemanticVersionComparable { /// Compare versions using the `SemVer` ranking system. /// - /// - Note: Build-meta-data have no influence on a version's rank. + /// - Note: ``BuildMetaData`` have no influence on a version's rank. static func < (lhs: Self, rhs: Self) -> Bool { // if versions are identical on major, minor and patch level, compare them lexicographiocally guard lhs.hasEqualVersionCore(as: rhs) else { diff --git a/Sources/SemanticVersionComparable/SemanticVersionComparable+Equatable.swift b/Sources/SemanticVersionComparable/SemanticVersionComparable+Equatable.swift index 0870aa0..0ab0126 100644 --- a/Sources/SemanticVersionComparable/SemanticVersionComparable+Equatable.swift +++ b/Sources/SemanticVersionComparable/SemanticVersionComparable+Equatable.swift @@ -6,7 +6,7 @@ // public extension SemanticVersionComparable { - /// Compares version objects for equality. + /// Compares types conforming to ``SemanticVersionComparable`` for equality. /// /// - Returns: `true` if version objects are equal. static func == (lhs: Self, rhs: Self) -> Bool { @@ -16,7 +16,7 @@ public extension SemanticVersionComparable { && lhs.prerelease == rhs.prerelease } - /// Strictly compares version objects for equality. + /// Strictly compares types conforming to``SemanticVersionComparable`` for equality. /// /// - Returns: `true` if version objects are strictly equal. static func === (lhs: Self, rhs: Self) -> Bool { diff --git a/Sources/SemanticVersionComparable/SemanticVersionComparable+Hashable.swift b/Sources/SemanticVersionComparable/SemanticVersionComparable+Hashable.swift index 17e9979..917faaa 100644 --- a/Sources/SemanticVersionComparable/SemanticVersionComparable+Hashable.swift +++ b/Sources/SemanticVersionComparable/SemanticVersionComparable+Hashable.swift @@ -8,7 +8,7 @@ public extension SemanticVersionComparable { /// Conformance to `Hashable` protocol. /// - /// - Note: Since build-meta-data are not considered in ranking semantic version, it won't be considered + /// - Note: Since ``BuildMetaData`` are not considered in ranking semantic version, it won't be considered /// here either. func hash(into hasher: inout Hasher) { hasher.combine(major) diff --git a/Sources/SemanticVersionComparable/SemanticVersionComparable.swift b/Sources/SemanticVersionComparable/SemanticVersionComparable.swift index d08c0e3..5364c20 100644 --- a/Sources/SemanticVersionComparable/SemanticVersionComparable.swift +++ b/Sources/SemanticVersionComparable/SemanticVersionComparable.swift @@ -15,7 +15,7 @@ /// /// versionOne == versionTwo // <- this statement is `true` /// -/// You can choose between a loosly or strictly comparison considering if you want to include the build-meta-data of +/// You can choose between a loosly or strictly comparison considering if you want to include the ``BuildMetaData`` of /// versions when comparing: /// /// let versionOne = Version(1, 0, 0, [.alpha]) @@ -45,18 +45,18 @@ public extension SemanticVersionComparable { /// A boolean value indicating the compatibility of two versions. As `SemVer` states two versions are /// compatible if they have the same major version. /// - /// - Parameter version: A version object that conforms to the `SemanticVersionComparable` protocol. + /// - Parameter version: A version object that conforms to the ``SemanticVersionComparable`` protocol. /// /// - Returns: `true` if both versions have equal major versions. func isCompatible(with version: Self) -> Bool { major == version.major } - /// Compare a object (lhs) conforming to `SemanticVersionComparable` with a greater version object (rhs). - /// Lhs must be a lower version to return a valid result. Otherwise `.noUpdate` will be + /// Compare a object (lhs) conforming to ``SemanticVersionComparable`` with a greater version object (rhs). + /// Lhs must be a lower version to return a valid result. Otherwise `VersionCompareResult.noUpdate` will be /// returned regardless of the difference between the two version objects. /// - /// - Parameter version: A version object that conforms to the `SemanticVersionComparable` protocol that will be + /// - Parameter version: A version object that conforms to the ``SemanticVersionComparable`` protocol that will be /// compared. /// /// - Returns: A `VersionCompareResult` as the severity of the update. @@ -94,7 +94,7 @@ public extension SemanticVersionComparable { /// Check if a version has an equal version core as another version. /// - /// - Parameter version: A version object that conforms to the `SemanticVersionComparable` protocol. + /// - Parameter version: A version object that conforms to the ``SemanticVersionComparable`` protocol. /// /// - Returns: `true` if the respective version cores are equal. /// diff --git a/Sources/Version+Bundle.swift b/Sources/Version+Bundle.swift index ee790be..5f22743 100644 --- a/Sources/Version+Bundle.swift +++ b/Sources/Version+Bundle.swift @@ -8,7 +8,7 @@ import Foundation public extension Bundle { - /// The version of the current bundle. + /// The ``Version`` of the current bundle. /// /// - Note: Uses the key `CFBundleShortVersionString` for retrieving version values. var shortVersion: Version? { @@ -20,7 +20,7 @@ public extension Bundle { return version } - /// The full version of the current bundle. + /// The full ``Version`` of the current bundle. /// /// - Note: Uses the key `CFBundleShortVersionString` and `CFBundleVersion` for retrieving version values. var version: Version? { diff --git a/Sources/Version+OS.swift b/Sources/Version+OS.swift index b8c7366..c5fae9c 100644 --- a/Sources/Version+OS.swift +++ b/Sources/Version+OS.swift @@ -8,7 +8,7 @@ import Foundation public extension ProcessInfo { - /// The version of the operating system on which the current process is executing. + /// The ``Version`` of the operating system on which the current process is executing. @available(macOS, introduced: 10.10) var comparableOperatingSystemVersion: Version { let osVersion: OperatingSystemVersion = operatingSystemVersion diff --git a/Sources/Version+StringInitializer.swift b/Sources/Version+StringInitializer.swift index f418065..ced095e 100644 --- a/Sources/Version+StringInitializer.swift +++ b/Sources/Version+StringInitializer.swift @@ -10,7 +10,7 @@ extension Version: LosslessStringConvertible { public var description: String { absoluteString } - /// Creates a new version from a string. + /// Creates a new ``Version`` from a string. /// /// - Parameter string: A string beeing parsed into a version. /// @@ -23,7 +23,7 @@ extension Version: LosslessStringConvertible { // MARK: - Version + ExpressibleByStringLiteral extension Version: ExpressibleByStringLiteral { - /// Creates a new version from a string literal. + /// Creates a new ``Version`` from a string literal. /// /// - Warning: Usage is not recommended unless the given string conforms to `SemVer`. public init(stringLiteral value: StringLiteralType) { @@ -35,7 +35,7 @@ extension Version: ExpressibleByStringLiteral { // MARK: - Version + ExpressibleByStringInterpolation extension Version: ExpressibleByStringInterpolation { - /// Creates a new version from a string interpolation. + /// Creates a new ``Version`` from a string interpolation. /// /// - Warning: Usage is not recommended unless the given string conforms to `SemVer`. public init(stringInterpolation: DefaultStringInterpolation) { diff --git a/Sources/Version.swift b/Sources/Version.swift index 7acfe23..bcda665 100644 --- a/Sources/Version.swift +++ b/Sources/Version.swift @@ -5,7 +5,7 @@ // Created by Marius Felkner on 29.12.20. // -/// A version type conforming to `SemanticVersionComparable` and therefor `SemVer`. +/// A version type conforming to ``SemanticVersionComparable`` and therefor `SemVer`. /// /// You can create a new version using strings, string literals and string interpolations, formatted /// like `MAJOR.MINOR.PATCH-PRERELEASE+BUILD`, or memberwise initialization. @@ -21,8 +21,8 @@ /// let version: Version = Version(1, 0, 0) /// let version: Version = Version(major: 1, minor: 0, patch: 0, prerelease: ["alpha, "1"], build: ["exp"]) /// -/// Pre-release identifiers or build-meta-data can be handled as strings or as enum cases with it associated raw -/// values (see `PrereleaseIdentifier` and `BuildMetaData` for more). +/// Pre-release identifiers or ``BuildMetaData`` can be handled as strings or as enum cases with it associated raw +/// values (see ``PrereleaseIdentifier`` and ``BuildMetaData`` for more). /// /// let version: Version = Version(major: 1, minor: 0, patch: 0, prerelease: ["alpha"], build: ["500"]) /// version.absoluteString // -> "1.0.0-alpha+500" @@ -45,7 +45,7 @@ public struct Version: Sendable, SemanticVersionComparable { // MARK: - Init - /// Creates a new version. + /// Creates a new ``Version``. /// /// - Parameters: /// - major: The `MAJOR` identifier of a version. @@ -74,14 +74,14 @@ public struct Version: Sendable, SemanticVersionComparable { self.build = build } - /// Creates a new version. + /// Creates a new ``Version``. /// /// - Parameters: /// - major: The `MAJOR` identifier of a version. /// - minor: The `MINOR` identifier of a version. /// - patch: The `PATCH` identifier of a version. - /// - prerelease: The pre-release identifier of a version. - /// - build: The build-meta-data of a version. + /// - prerelease: The ``PrereleaseIdentifier`` identifier of a version. + /// - build: The ``BuildMetaData`` of a version. /// /// - Note: Unsigned integers are used to provide an straightforward way to make sure that the identifiers /// are not negative numbers. @@ -96,7 +96,7 @@ public struct Version: Sendable, SemanticVersionComparable { self.init(major, minor, patch, prerelease, build) } - /// Creates a new version using a string. + /// Creates a new ``Version`` using a string. /// /// - Parameter string: The string representing a version. public init?(private string: String) { @@ -215,7 +215,7 @@ public struct Version: Sendable, SemanticVersionComparable { // MARK: - Static Accessors public extension Version { - /// An initial version representing the string `0.0.0`. + /// An initial ``Version`` representing the string `0.0.0`. static var initial: Version = .init(major: 0, minor: 0, patch: 0) }