Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DNM] Comply SymbolGraph.SemanticVersion to SemVer 2.0.0 #36

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Commits on May 26, 2022

  1. comply SymbolGraph.SemanticVersion to SemVer 2.0.0

    This is a correct but somewhat over-engineered reinplementation of `SymbolGraph.SemanticVersion`.
    
    The most important (and also most invasive) changes are the handling of pre-release and build metadata. These include their validation and (their contribution to version-) comparison.
    
    Some less important changes include the following:
    
    - Version core identifiers are changed to be backed by `UInt`, because they’re not allowed be less than 0. This might appear to be a departure from the convention of using `Int` for even always-positive integers (e.g. `Array.Index`). However, in this specific case, the use of version coure identifiers is mostly contained in the domain of constructing semantic versions, and does not have any apparent need to participate in numeric operations outside of the domain other than comparing individual identifiers. And considering Swift’s current lack of build-time evaluation and error handling, using `UInt` looks like the right trade off between ergnomics and “safety”.
    
    - Deprecated the initializer for a new one that throws error, so that erros can be handled instead of runtime trapping.
    
    - Added some facilities for inspecting and working with versions’ semantics in general.
    
    - Updated the tools version specifier in the main package manifest to “5.6”, because Swift 5.2 has some type-checking bugs that affect the new implementation.
    
    - Added a lot of tests, which should cover a large area of (edge) cases.
    WowbaggersLiquidLunch committed May 26, 2022
    Configuration menu
    Copy the full SHA
    2dd562b View commit details
    Browse the repository at this point in the history

Commits on May 27, 2022

  1. revert the main swift version specifier back to “5.2”

    It appears that whatever caused the type checking problems before has already been fixed.
    WowbaggersLiquidLunch committed May 27, 2022
    Configuration menu
    Copy the full SHA
    ff3e40f View commit details
    Browse the repository at this point in the history
  2. elaborate a bit more on why we cannot omit empty subsequences when sp…

    …litting the prerelease into identifiers
    
    Co-authored-by: David Rönnqvist <[email protected]>
    WowbaggersLiquidLunch and d-ronnqvist committed May 27, 2022
    Configuration menu
    Copy the full SHA
    4e2b309 View commit details
    Browse the repository at this point in the history
  3. use the convenient computed property `isAllowedInSemanticVersionIdent…

    …ifier` when validating build metadata
    
    Co-authored-by: David Rönnqvist <[email protected]>
    WowbaggersLiquidLunch and d-ronnqvist committed May 27, 2022
    Configuration menu
    Copy the full SHA
    b5f7003 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ecbede7 View commit details
    Browse the repository at this point in the history
  5. move common identifier validation logic out of Prerelease.swift

    It’s used for more than validating prerelease.
    WowbaggersLiquidLunch committed May 27, 2022
    Configuration menu
    Copy the full SHA
    1790ae6 View commit details
    Browse the repository at this point in the history
  6. add a non-throwing initializer that takes only version core identifiers

    This initializer should be much more ergonomic to use in the common cases, and it's safe because it's guaranteed not to encounter any error.
    WowbaggersLiquidLunch committed May 27, 2022
    Configuration menu
    Copy the full SHA
    4d9783d View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2022

  1. add a comment referring to the SR-14665

    Reference to [SR-14665](swiftlang/swift#57016) links to more explanation on why the manual `==` implemenatation is necessary.
    WowbaggersLiquidLunch committed Jun 4, 2022
    Configuration menu
    Copy the full SHA
    c27b2bf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    98a49de View commit details
    Browse the repository at this point in the history