-
Notifications
You must be signed in to change notification settings - Fork 1
Make semver module public and add documentation #2
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR makes the semver module public and enriches its VersionMap API with comprehensive documentation.
- Exposes
semverin the crate’s public API. - Adds module- and item-level docs, including usage examples and alternate lookup logic.
- Documents all
VersionMapmethods and internal helpers.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/semver.rs | Added public docs for VersionMap, its methods, and version_alternate. |
| src/lib.rs | Changed mod semver; to pub mod semver; to expose the module. |
Comments suppressed due to low confidence (1)
src/semver.rs:19
- Add unit tests for the alternate lookup logic covering: pre-release versions (should return
None), major-version fallback, minor-version fallback when major is 0, and patch-level fallback. Also testget_or_latestbehavior whenNoneis provided or when the map is empty.
- For minor versions > 0 (when major is 0): alternate is `0.minor.0`
Graphite Automations"Request reviewers once CI passes" took an action on this PR • (05/27/25)1 assignee was added and 1 reviewer was added to this PR based on bill fumerola's automation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR exposes the semver module publicly and enhances its documentation to improve clarity and usability.
- Made the semver module public in lib.rs
- Added comprehensive module- and method-level documentation in src/semver.rs
- Included detailed usage examples and alternate lookup logic documentation
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/semver.rs | Added documentation, new methods, and alternate lookup logic for VersionMap. |
| src/lib.rs | Updated semver module from private to public. |
Comments suppressed due to low confidence (1)
src/semver.rs:109
- The alternate lookup condition in get() checks version.build.is_empty(), but according to the alternate logic and the version_alternate() implementation, it should check if version.pre is empty to correctly bypass alternate lookups for pre-release versions.
if version.build.is_empty() {

Expose semver module and improve its documentation
This PR makes the
semvermodule public and adds comprehensive documentation to improve its usability. The changes include:VersionMapVersionMapstruct and all its methodsThese changes make the semantic versioning functionality available to consumers of the library and provide clear guidance on how to use it effectively.