Open RolphR opened 2 months ago
It would be great to have the ability to do SemVer version checks (based on https://github.com/hashicorp/go-version). More specifically the following function signatures:
provider::assert::semver_version("1.2.3")
true
provider::assert::semver_version("foobar")
false
provider::assert::semver_check("~> 1.8", "1.9")
provider::assert::semver_check("~> 1.8", "2.0")
provider::assert::semver_check("~> 1.8", "foobar")
provider::assert::semver_check("foobar", "2.0")
error
provider::assert::semver_constraint("~> 1.8")
provider::assert::semver_constraint("foobar")
The function names still need to be made consistent with Hashicorp/provider naming. What are your opinions on the function names?
It would be great to have the ability to do SemVer version checks (based on https://github.com/hashicorp/go-version). More specifically the following function signatures:
provider::assert::semver_version("1.2.3")
->true
(valid semver)provider::assert::semver_version("foobar")
->false
(invalid semver)provider::assert::semver_check("~> 1.8", "1.9")
->true
(valid semver (2nd arg) matches valid constraint (1st arg))provider::assert::semver_check("~> 1.8", "2.0")
->false
(valid semver (2nd arg) doesn't match valid constraint (1st arg))provider::assert::semver_check("~> 1.8", "foobar")
->false
(invalid semver)provider::assert::semver_check("foobar", "2.0")
->error
(invalid constraint)provider::assert::semver_constraint("~> 1.8")
->true
(valid semver constraint)provider::assert::semver_constraint("foobar")
->false
(invalid semver constraint)The function names still need to be made consistent with Hashicorp/provider naming. What are your opinions on the function names?