Repository: gembaadvantage/uplift
Pull request #33 (2021-09-04 19:49:02)

fix: ignoring first version from config

codecov-commenter: # [Codecov](https://codecov.io/gh/gembaadvantage/uplift/pull/33?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gembaadvantage) Report
> Merging [#33](https://codecov.io/gh/gembaadvantage/uplift/pull/33?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gembaadvantage) (e6e6594) into [main](https://codecov.io/gh/gembaadvantage/uplift/commit/41642803bd3a673875b74dedd1c030781663ff4e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gembaadvantage) (4164280) will **not change** coverage.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/gembaadvantage/uplift/pull/33/graphs/tree.svg?width=650&height=150&src=pr&token=K13FIQH5ZB&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gembaadvantage)](https://codecov.io/gh/gembaadvantage/uplift/pull/33?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gembaadvantage)

```diff
@@           Coverage Diff           @@
##             main      #33   +/-   ##
=======================================
  Coverage   81.05%   81.05%           
=======================================
  Files           5        5           
  Lines         380      380           
=======================================
  Hits          308      308           
  Misses         58       58           
  Partials       14       14           
```


| [Impacted Files](https://codecov.io/gh/gembaadvantage/uplift/pull/33?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gembaadvantage) | Coverage Δ | |
|---|---|---|
| [internal/semver/bump.go](https://codecov.io/gh/gembaadvantage/uplift/pull/33/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gembaadvantage#diff-aW50ZXJuYWwvc2VtdmVyL2J1bXAuZ28=) | `86.41% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/gembaadvantage/uplift/pull/33?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gembaadvantage).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gembaadvantage)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/gembaadvantage/uplift/pull/33?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gembaadvantage). Last update [4164280...e6e6594](https://codecov.io/gh/gembaadvantage/uplift/pull/33?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gembaadvantage). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gembaadvantage).


Patch:
diff --git a/internal/semver/bump.go b/internal/semver/bump.go
index 3e1c4b4..28a555b 100644
--- a/internal/semver/bump.go
+++ b/internal/semver/bump.go
@@ -116,7 +116,7 @@ func (b Bumper) Bump() error {
 
 	ver := git.LatestTag()
 	if ver == "" {
-		ver = firstVersion
+		ver = b.config.FirstVersion
 		b.logger.Success("no previous tags exist, using first version: %s", ver)
 	} else {
 		if ver, err = b.bumpVersion(ver, inc); err != nil {


Test patch:
diff --git a/internal/semver/bump_test.go b/internal/semver/bump_test.go
index d14da4b..5559303 100644
--- a/internal/semver/bump_test.go
+++ b/internal/semver/bump_test.go
@@ -124,12 +124,12 @@ func TestBumpFirstVersion(t *testing.T) {
 	git.InitRepo(t)
 	git.EmptyCommit(t, "feat: Lorem ipsum dolor sit amet")
 
-	b := NewBumper(io.Discard, BumpOptions{Config: config.Uplift{FirstVersion: "0.1.0"}})
+	b := NewBumper(io.Discard, BumpOptions{Config: config.Uplift{FirstVersion: "v0.1.0"}})
 	err := b.Bump()
 	require.NoError(t, err)
 
 	v := git.LatestTag()
-	assert.Equal(t, "0.1.0", v)
+	assert.Equal(t, "v0.1.0", v)
 }
 
 func TestBumpEmptyRepo(t *testing.T) {