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

TLC calculation #17

Merged
merged 9 commits into from
Sep 2, 2024
Merged

TLC calculation #17

merged 9 commits into from
Sep 2, 2024

Conversation

janniclas
Copy link
Contributor

No description provided.

- previously the adapter always returned an error result due to a missing explicit return statement
- added version validation to make sure to always have valid semantic version strings
isDefault = isDefault,
// this step harmonizes possibly weired version formats like 2.4 or 5
// those are parsed to 2.4.0 and 5.0.0
versionNumber = validateAndHarmonizeVersionString(versionNumber)
Copy link
Collaborator

Choose a reason for hiding this comment

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

what about 4.0.0.0 ? In some ecosystems, while not recommened, it's allowed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

// Version parsing pattern: 1.2.3-alpha+build
internal const val VERSION_REGEX: String = "^$CORE_VERSION$PRE_RELEASE?$BUILD?\$"

// Prefixed version parsing pattern: v1.2-alpha+build
internal const val LOOSE_VERSION_REGEX: String = "^v?$LOOSE_CORE_VERSION$PRE_RELEASE?$BUILD?\$"

the regex from the semver library we use (and the semver standard) doesn't allow that and will fail with an invalid version exception (which we should probably catch so we don't crash due to one library with weired format)

@janniclas janniclas marked this pull request as ready for review September 2, 2024 08:37
@janniclas janniclas merged commit 419e21b into main Sep 2, 2024
1 check passed
@janniclas janniclas deleted the feature/tlcCalculation branch September 6, 2024 11:16
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.

2 participants