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

Semver class implementation #523

Merged
merged 20 commits into from May 14, 2024
Merged

Semver class implementation #523

merged 20 commits into from May 14, 2024

Conversation

gthea
Copy link
Contributor

@gthea gthea commented May 13, 2024

iOS SDK

What did you accomplish?

  • Added implementation for semver class.

@gthea gthea self-assigned this May 13, 2024
@gthea gthea marked this pull request as ready for review May 13, 2024 14:50
@gthea gthea requested a review from a team as a code owner May 13, 2024 14:50
Split/Matchers/Semver/Semver.swift Outdated Show resolved Hide resolved
Split/Matchers/Semver/Semver.swift Outdated Show resolved Hide resolved
Split/Matchers/Semver/Semver.swift Outdated Show resolved Hide resolved
Split/Matchers/Semver/Semver.swift Outdated Show resolved Hide resolved
@gthea gthea requested a review from javrudsky May 14, 2024 14:29
Copy link
Contributor

@javrudsky javrudsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! Just some comments.

private var major: Int64
private var minor: Int64
private var patch: Int64
private var major: Int64 = -1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about replacing this values by a struct like:

struct SemverModel {
let major: Int64
let minor: Int64
let patch: Int64
...
}


return (major, minor, patch)
}

private func setVersion() -> String {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a function toString() from SemverModel

Split/Matchers/Semver/Semver.swift Outdated Show resolved Hide resolved
return metadataString
}

private func getAndRemovePreReleaseIfExists(_ vWithoutMetadata: String) throws -> (preRelease: [String], isStable: Bool, versionWithoutPreRelease: String) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can use the model here too:
func versionWithoutPreRelease(withoutMetaData: String) throws -> SemverModel {

@gthea gthea requested a review from javrudsky May 14, 2024 17:25
@gthea gthea merged commit 4ad9008 into semver_baseline May 14, 2024
@gthea gthea deleted the SDKS-8351 branch May 14, 2024 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants