Skip to content

Conversation

@katzoded
Copy link
Contributor

the reason for this change was to make sure each part of the build-identifiers is an unsigned long long

theoretically also unsigned long is 64bit, however it depends on the compilation flags
per only if LP64 is defined in compilation the unsigned long would be 64bit

Comment on lines +41 to +46
const std::string version_pattern = "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)"
"(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))"
"?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$";
const std::string loose_version_pattern = "^v?(0|[1-9]\\d*)(?:\\.(0|[1-9]\\d*))?(?:\\.(0|[1-9]\\d*))"
"?(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))"
"?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

author notes:
those 2 patterns weren't modified. just to ease reading it was fragmented into multiple lines

@katzoded katzoded changed the title making sure each of the build-identifiers are uint64_t making sure each of the build-identifiers is uint64_t Apr 12, 2023
@katzoded katzoded changed the title making sure each of the build-identifiers is uint64_t making sure each of the build-identifier is uint64_t Apr 12, 2023
namespace semver
{

using build_identifier_part = uint64_t;
Copy link
Owner

@z4kn4fein z4kn4fein Apr 12, 2023

Choose a reason for hiding this comment

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

As it's used for the type of each numeric part of a version and not just for the pre-release/build identifier's numeric part, could we name it numeric_part?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@katzoded Thanks for the contribution! I have some comments regarding the naming, but after fixing that, I'll approve.

@z4kn4fein ,
You are welcome, I addressed the required comments.

semver_exception(const std::string& message) : std::runtime_error(message) { }
};

inline build_identifier_part parse_build_identifier_part(const std::string& version_part)
Copy link
Owner

Choose a reason for hiding this comment

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

According to the previous comment, it might be better to name this method parse_numeric_part().

@z4kn4fein
Copy link
Owner

z4kn4fein commented Apr 12, 2023

@katzoded Thanks for the contribution! I have some comments regarding the naming, but after fixing that, I'll approve.

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (4219fee) 99.01% compared to head (f614975) 99.02%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main       #5   +/-   ##
=======================================
  Coverage   99.01%   99.02%           
=======================================
  Files           5        5           
  Lines         509      512    +3     
=======================================
+ Hits          504      507    +3     
  Misses          5        5           
Impacted Files Coverage Δ
include/semver/semver.hpp 97.22% <100.00%> (+0.03%) ⬆️
test/version.cpp 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@katzoded katzoded requested a review from z4kn4fein April 13, 2023 16:20
@z4kn4fein z4kn4fein merged commit 2fc21c6 into z4kn4fein:main Apr 13, 2023
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.

3 participants