feat!: add metadata to Tag object and update Parse(), Equals() and String() #7

Merged
decentral1se merged 2 commits from knoflook/tagcmp:main into main 2021-10-07 13:03:38 +00:00
Owner

now we can parse tags such as
1.3.1+5.9.6-alpine
this will parse to

type Tag struct {
	Major        "1"
	Minor        "3"
	MissingMinor false
	Patch        "1" 
	MissingPatch false 
	Suffix       ""
	UsesV        false
	Metadata     "5.9.6-alpine"
}

it's parsed according to semver specification, so -alpine isn't split from the rest

<valid semver> ::= <version core>
                 | <version core> "-" <pre-release>
                 | <version core> "+" <build>
                 | <version core> "-" <pre-release> "+" <build>

but if we have 2.0.0-rc1+6.0.2-alpine it should be parsed to:

type Tag struct {
	Major        "2"
	Minor        "0"
	MissingMinor false
	Patch        "0" 
	MissingPatch false 
	Suffix       "rc1"
	UsesV        false
	Metadata     "6.0.2-alpine"
}
now we can parse tags such as `1.3.1+5.9.6-alpine` this will parse to ``` type Tag struct { Major "1" Minor "3" MissingMinor false Patch "1" MissingPatch false Suffix "" UsesV false Metadata "5.9.6-alpine" } ``` it's parsed according to semver specification, so `-alpine` isn't split from the rest ``` <valid semver> ::= <version core> | <version core> "-" <pre-release> | <version core> "+" <build> | <version core> "-" <pre-release> "+" <build> ``` but if we have `2.0.0-rc1+6.0.2-alpine` it should be parsed to: ``` type Tag struct { Major "2" Minor "0" MissingMinor false Patch "0" MissingPatch false Suffix "rc1" UsesV false Metadata "6.0.2-alpine" } ```
knoflook added 1 commit 2021-10-07 10:28:11 +00:00
feat!: add metadata to Tag object and update Parse(), Equals() and String()
All checks were successful
continuous-integration/drone/pr Build is passing
63ec2c5ff3
knoflook added 1 commit 2021-10-07 12:29:34 +00:00
fix: get patternCounts to recognise tags with metadata correctly
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
aa7b4ff851
Owner

Wonderful @knoflook! Would you mind writing a few test for this in the test_... file which should be handy since there are a bunch of examples. Handier to maintain this going forward 🙏

Wonderful @knoflook! Would you mind writing a few test for this in the `test_...` file which should be handy since there are a bunch of examples. Handier to maintain this going forward 🙏
decentral1se merged commit aa7b4ff851 into main 2021-10-07 13:03:38 +00:00
Sign in to join this conversation.
No description provided.