Skip to content

Commit

Permalink
change: use docc linking
Browse files Browse the repository at this point in the history
  • Loading branch information
mflknr committed Jun 17, 2024
1 parent c33cc68 commit e7ee725
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions Sources/Helper/VersionCompareResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
///
Expand Down
4 changes: 2 additions & 2 deletions Sources/Version+Bundle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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? {
Expand All @@ -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? {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Version+OS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Sources/Version+StringInitializer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down
18 changes: 9 additions & 9 deletions Sources/Version.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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"
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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) {
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit e7ee725

Please sign in to comment.