ToSemanticString should always return 3-component version string - #94
Merged
Conversation
Copilot created this pull request from a session on behalf of
Tyrrrz
July 24, 2026 12:07
View session
Tyrrrz
approved these changes
Jul 24, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## prime #94 +/- ##
==========================================
+ Coverage 86.36% 86.51% +0.15%
==========================================
Files 78 78
Lines 1393 1409 +16
Branches 239 242 +3
==========================================
+ Hits 1203 1219 +16
Misses 137 137
Partials 53 53 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts Version.ToSemanticString() to always output at least three numeric components (major.minor.patch) by converting new Version(major, minor) from "major.minor" to "major.minor.0", aligning output with semantic-version expectations.
Changes:
- Ensure
ToSemanticString()appends".0"whenVersion.Buildis unset (Build < 0). - Update the corresponding unit test expectation for
new Version(1, 2)to"1.2.0".
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| PowerKit/Extensions/VersionExtensions.cs | Ensures at least 3 components by appending .0 when the build/patch component is missing. |
| PowerKit.Tests/Extensions/VersionExtensionsTests.cs | Updates expected string output for new Version(1, 2) to match the new behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This was referenced Aug 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Version.ToSemanticString()could return a 2-component string (e.g."1.2") when theBuildcomponent was unset, violating the semantic versioning requirement of always havingmajor.minor.patch.Changes
VersionExtensions.cs: Append.0whenBuild < 0, ensuring a minimum of 3 componentsVersionExtensionsTests.cs: Update expectation fornew Version(1, 2)from"1.2"→"1.2.0"