From bd958e70edff3c25491347db4ad1af2165877314 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Tue, 2 Mar 2021 18:43:55 -0600 Subject: [PATCH 01/82] chore(deps): add initial renovatebot configuration (#102) --- .github/renovate.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/renovate.json diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 00000000..1aa89153 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,25 @@ +{ + "semanticCommits": true, + "prHourlyLimit": 5, + "reviewersFromCodeOwners": true, + "labels": [ + "dependencies" + ], + "extends": [ + "config:base", + "group:allNonMajor" + ], + "postUpdateOptions": ["gomodTidy"], + "major": { + "labels": [ + "dependencies", + "major" + ] + }, + "minor": { + "labels": [ + "dependencies", + "minor" + ] + } +} From 289163a1e2c4b2ccfee07506000065fc0065eb36 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Thu, 4 Mar 2021 13:59:32 -0600 Subject: [PATCH 02/82] fix(deps): update module gopkg.in/alecaivazis/survey.v1 to github.com/AlecAivazis/survey/v2 (#108) --- cmd/git-chglog/questioner.go | 2 +- go.mod | 2 +- go.sum | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/git-chglog/questioner.go b/cmd/git-chglog/questioner.go index 8ba835e3..8773398a 100644 --- a/cmd/git-chglog/questioner.go +++ b/cmd/git-chglog/questioner.go @@ -7,7 +7,7 @@ import ( "strings" gitcmd "github.com/tsuyoshiwada/go-gitcmd" - survey "gopkg.in/AlecAivazis/survey.v1" + survey "github.com/AlecAivazis/survey/v2" ) // Answer ... diff --git a/go.mod b/go.mod index b49498b4..480c6670 100644 --- a/go.mod +++ b/go.mod @@ -3,13 +3,13 @@ module github.com/git-chglog/git-chglog go 1.15 require ( + github.com/AlecAivazis/survey/v2 v2.2.8 github.com/fatih/color v1.10.0 github.com/imdario/mergo v0.3.11 github.com/mattn/go-colorable v0.1.8 github.com/stretchr/testify v1.6.1 github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df github.com/urfave/cli v1.22.5 - gopkg.in/AlecAivazis/survey.v1 v1.8.8 gopkg.in/kyokomi/emoji.v1 v1.5.1 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index ea1d32e6..9dcdeb3b 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,5 @@ -github.com/AlecAivazis/survey/v2 v2.0.5/go.mod h1:WYBhg6f0y/fNYUuesWQc0PKbJcEliGcYHB9sNT3Bg74= +github.com/AlecAivazis/survey/v2 v2.2.8 h1:TgxCwybKdBckmC+/P9/5h49rw/nAHe/itZL0dgHs+Q0= +github.com/AlecAivazis/survey/v2 v2.2.8/go.mod h1:9DYvHgXtiXm6nCn+jXnOXLKbH+Yo9u8fAS/SduGdoPk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8 h1:xzYJEypr/85nBpB11F9br+3HUrpgb+fcm5iADzXXYEw= github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc= @@ -50,9 +51,8 @@ golang.org/x/sys v0.0.0-20190530182044-ad28b68e88f1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -gopkg.in/AlecAivazis/survey.v1 v1.8.8 h1:5UtTowJZTz1j7NxVzDGKTz6Lm9IWm8DDF6b7a2wq9VY= -gopkg.in/AlecAivazis/survey.v1 v1.8.8/go.mod h1:CaHjv79TCgAvXMSFJSVgonHXYWxnhzI3eoHtnX5UgUo= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/kyokomi/emoji.v1 v1.5.1 h1:beetH5mWDMzFznJ+Qzd5KVHp79YKhVUMcdO8LpRLeGw= From 8195e1283378bb1bad06e0ec33baea87c5e5a599 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 4 Mar 2021 15:32:24 -0600 Subject: [PATCH 03/82] fix(deps): update module github.com/stretchr/testify to v1.7.0 (#103) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 480c6670..14d37f72 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/fatih/color v1.10.0 github.com/imdario/mergo v0.3.11 github.com/mattn/go-colorable v0.1.8 - github.com/stretchr/testify v1.6.1 + github.com/stretchr/testify v1.7.0 github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df github.com/urfave/cli v1.22.5 gopkg.in/kyokomi/emoji.v1 v1.5.1 diff --git a/go.sum b/go.sum index 9dcdeb3b..204fb8b9 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,8 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5I github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df h1:Y2l28Jr3vOEeYtxfVbMtVfOdAwuUqWaP9fvNKiBVeXY= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df/go.mod h1:pnyouUty/nBr/zm3GYwTIt+qFTLWbdjeLjZmJdzJOu8= github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= From 43006610a167bfb7a8693d1ae61aaa392c460dca Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Thu, 4 Mar 2021 17:18:00 -0600 Subject: [PATCH 04/82] fix(deps): update module github.com/urfave/cli to v2 (#107) * Migration guide https://github.com/urfave/cli/blob/master/docs/migrate-v1-to-v2.md --- cmd/git-chglog/main.go | 24 ++++++++++++------------ cmd/git-chglog/main_test.go | 2 +- go.mod | 2 +- go.sum | 6 +++--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cmd/git-chglog/main.go b/cmd/git-chglog/main.go index 32a1c954..6f262476 100644 --- a/cmd/git-chglog/main.go +++ b/cmd/git-chglog/main.go @@ -8,7 +8,7 @@ import ( "github.com/fatih/color" "github.com/mattn/go-colorable" gitcmd "github.com/tsuyoshiwada/go-gitcmd" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) func CreateApp(actionFunc cli.ActionFunc) *cli.App { @@ -71,57 +71,57 @@ func CreateApp(actionFunc cli.ActionFunc) *cli.App { app.Flags = []cli.Flag{ // init - cli.BoolFlag{ + &cli.BoolFlag{ Name: "init", Usage: "generate the git-chglog configuration file in interactive", }, // config - cli.StringFlag{ + &cli.StringFlag{ Name: "config, c", Usage: "specifies a different configuration file to pick up", Value: ".chglog/config.yml", }, // output - cli.StringFlag{ + &cli.StringFlag{ Name: "output, o", Usage: "output path and filename for the changelogs. If not specified, output to stdout", }, - cli.StringFlag{ + &cli.StringFlag{ Name: "next-tag", Usage: "treat unreleased commits as specified tags (EXPERIMENTAL)", }, // silent - cli.BoolFlag{ + &cli.BoolFlag{ Name: "silent", Usage: "disable stdout output", }, // no-color - cli.BoolFlag{ + &cli.BoolFlag{ Name: "no-color", Usage: "disable color output", - EnvVar: "NO_COLOR", + EnvVars: []string{"NO_COLOR"}, }, // no-emoji - cli.BoolFlag{ + &cli.BoolFlag{ Name: "no-emoji", Usage: "disable emoji output", - EnvVar: "NO_EMOJI", + EnvVars: []string{"NO_EMOJI"}, }, // no-case - cli.BoolFlag{ + &cli.BoolFlag{ Name: "no-case", Usage: "disable case sensitive filters", }, // tag-filter-pattern - cli.StringFlag{ + &cli.StringFlag{ Name: "tag-filter-pattern, p", Usage: "Regular expression of tag filter. Is specified, only matched tags will be picked", }, diff --git a/cmd/git-chglog/main_test.go b/cmd/git-chglog/main_test.go index 48bc1178..b7f4e396 100644 --- a/cmd/git-chglog/main_test.go +++ b/cmd/git-chglog/main_test.go @@ -2,7 +2,7 @@ package main import ( "github.com/stretchr/testify/assert" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" "testing" ) diff --git a/go.mod b/go.mod index 14d37f72..431480e8 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/mattn/go-colorable v0.1.8 github.com/stretchr/testify v1.7.0 github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df - github.com/urfave/cli v1.22.5 + github.com/urfave/cli/v2 v2.3.0 gopkg.in/kyokomi/emoji.v1 v1.5.1 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index 204fb8b9..0397c762 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df h1:Y2l28Jr3vOEeYtxfVbMtVfOdAwuUqWaP9fvNKiBVeXY= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df/go.mod h1:pnyouUty/nBr/zm3GYwTIt+qFTLWbdjeLjZmJdzJOu8= -github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= -github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= +github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 h1:8dUaAV7K4uHsF56JQWkprecIQKdPHtR9jCHF5nB8uzc= golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -57,7 +57,7 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/kyokomi/emoji.v1 v1.5.1 h1:beetH5mWDMzFznJ+Qzd5KVHp79YKhVUMcdO8LpRLeGw= gopkg.in/kyokomi/emoji.v1 v1.5.1/go.mod h1:N9AZ6hi1jHOPn34PsbpufQZUcKftSD7WgS2pgpmH4Lg= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= From efa1c30c0ad5ec118acf8a2136408a023b03036d Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Fri, 5 Mar 2021 11:54:38 -0600 Subject: [PATCH 05/82] fix(deps): update module gopkg.in/kyokomi/emoji.v1 to github.com/kyokomi/emoji/v2 (#109) --- cmd/git-chglog/logger.go | 2 +- cmd/git-chglog/logger_test.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/git-chglog/logger.go b/cmd/git-chglog/logger.go index 1c65b004..be64fc6e 100644 --- a/cmd/git-chglog/logger.go +++ b/cmd/git-chglog/logger.go @@ -7,7 +7,7 @@ import ( "regexp" "github.com/fatih/color" - emoji "gopkg.in/kyokomi/emoji.v1" + emoji "github.com/kyokomi/emoji/v2" ) // Logger ... diff --git a/cmd/git-chglog/logger_test.go b/cmd/git-chglog/logger_test.go index 1e62de2a..17bb8598 100644 --- a/cmd/git-chglog/logger_test.go +++ b/cmd/git-chglog/logger_test.go @@ -7,7 +7,7 @@ import ( "github.com/fatih/color" "github.com/stretchr/testify/assert" - emoji "gopkg.in/kyokomi/emoji.v1" + emoji "github.com/kyokomi/emoji/v2" ) func TestLoggerLogSilent(t *testing.T) { diff --git a/go.mod b/go.mod index 431480e8..4f0140ec 100644 --- a/go.mod +++ b/go.mod @@ -6,10 +6,10 @@ require ( github.com/AlecAivazis/survey/v2 v2.2.8 github.com/fatih/color v1.10.0 github.com/imdario/mergo v0.3.11 + github.com/kyokomi/emoji/v2 v2.2.8 github.com/mattn/go-colorable v0.1.8 github.com/stretchr/testify v1.7.0 github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df github.com/urfave/cli/v2 v2.3.0 - gopkg.in/kyokomi/emoji.v1 v1.5.1 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index 0397c762..de399e24 100644 --- a/go.sum +++ b/go.sum @@ -18,6 +18,8 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNU github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kr/pty v1.1.4 h1:5Myjjh3JY/NaAi4IsUbHADytDyl1VE1Y9PXDlL+P/VQ= github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kyokomi/emoji/v2 v2.2.8 h1:jcofPxjHWEkJtkIbcLHvZhxKgCPl6C7MyjTrD4KDqUE= +github.com/kyokomi/emoji/v2 v2.2.8/go.mod h1:JUcn42DTdsXJo1SWanHh4HKDEyPaR5CqkmoirZZP9qE= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -55,8 +57,6 @@ golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/kyokomi/emoji.v1 v1.5.1 h1:beetH5mWDMzFznJ+Qzd5KVHp79YKhVUMcdO8LpRLeGw= -gopkg.in/kyokomi/emoji.v1 v1.5.1/go.mod h1:N9AZ6hi1jHOPn34PsbpufQZUcKftSD7WgS2pgpmH4Lg= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= From 8713d9685647e0440e316c1aa31a8cdebfae6d43 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Tue, 9 Mar 2021 03:21:47 -0600 Subject: [PATCH 06/82] fix(init): support OptionAnswer form in survey/v2 (#113) --- cmd/git-chglog/questioner.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/git-chglog/questioner.go b/cmd/git-chglog/questioner.go index 8773398a..99ba5b23 100644 --- a/cmd/git-chglog/questioner.go +++ b/cmd/git-chglog/questioner.go @@ -81,8 +81,11 @@ func (q *questionerImpl) ask() (*Answer, error) { tpls := q.getPreviewableList(templates) var previewableTransform = func(ans interface{}) (newAns interface{}) { - if s, ok := ans.(string); ok { - newAns = q.parsePreviewableList(s) + if s, ok := ans.(survey.OptionAnswer); ok { + newAns = survey.OptionAnswer{ + Value: q.parsePreviewableList(s.Value), + Index: s.Index, + } } return } From a1c84d7a0d1ed30644b3295aeeae1129c0e635e8 Mon Sep 17 00:00:00 2001 From: Chao Li Date: Thu, 11 Mar 2021 15:40:32 +0800 Subject: [PATCH 07/82] feat: add Jira integration (#52) --- Makefile | 2 +- README.md | 83 +++++ chglog.go | 49 +-- chglog_test.go | 312 +++++++++--------- cmd/git-chglog/cli.go | 6 +- cmd/git-chglog/config.go | 70 ++-- cmd/git-chglog/context.go | 5 + cmd/git-chglog/generator.go | 6 +- cmd/git-chglog/generator_mock.go | 2 +- cmd/git-chglog/initializer.go | 5 +- cmd/git-chglog/main.go | 46 ++- commit_parser.go | 74 +++-- commit_parser_test.go | 186 ++++++++--- example_test.go | 92 +++--- fields.go | 36 +- go.mod | 1 + go.sum | 15 + jira.go | 36 ++ jira_test.go | 42 +++ cmd/git-chglog/logger.go => logger.go | 2 +- .../logger_test.go => logger_test.go | 2 +- testdata/gitlog_jira.txt | 1 + 22 files changed, 742 insertions(+), 331 deletions(-) create mode 100644 jira.go create mode 100644 jira_test.go rename cmd/git-chglog/logger.go => logger.go (98%) rename cmd/git-chglog/logger_test.go => logger_test.go (99%) create mode 100644 testdata/gitlog_jira.txt diff --git a/Makefile b/Makefile index 01fc1824..1f27d92a 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ clean: .PHONY: build build: - go build -i -o git-chglog ./cmd/git-chglog + go build -o git-chglog ./cmd/git-chglog .PHONY: test test: diff --git a/README.md b/README.md index e504d930..8b5e1c76 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ - [`options.notes`](#optionsnotes) - [Templates](#templates) - [Supported Styles](#supported-styles) + - [Jira Integration](#jira-integration) - [FAQ](#faq) - [TODO](#todo) - [Thanks](#thanks) @@ -486,6 +487,88 @@ See the godoc [RenderData][doc-render-data] documentation for available variable > :memo: Even with styles that are not yet supported, it is possible to make ordinary CHANGELOG. + +## Jira Integration + + +Jira is a popular project management tool. When a project uses Jira to track feature development and bug fixes, +it may also want to generate change log based information stored in Jira. With embedding a Jira story id in git +commit header, the git-chglog tool may automatically fetch data of the story from Jira, those data then can be +used to render the template. + +Take the following steps to add Jira integration: + +#### 1. Change the header parse pattern to recognize Jira issue id in the configure file. + +__Where Jira issue is identical Jira story.__ + +The following is a sample pattern: + + ```yaml + header: + pattern: "^(?:(\\w*)|(?:\\[(.*)\\])?)\\:\\s(.*)$" + pattern_maps: + - Type + - JiraIssueId + - Subject + ``` + +This sample pattern can match both forms of commit headers: + +* `feat: new feature of something` +* `[JIRA-ID]: something` + +#### 2. Add Jira configuration to the configure file. + +The following is a sample: + + ```yaml + jira: + info: + username: u + token: p + url: https://jira.com + issue: + type_maps: + Task: fix + Story: feat + description_pattern: "(.*)" + ``` + +Here you need to define Jira URL, access username and token (password). If you don't want to +write your Jira access credential in configure file, you may define them with environment variables: +`JIRA_URL`, `JIRA_USERNAME` and `JIRA_TOKEN`. + +You also needs to define a issue type map. In above sample, Jira issue type `Task` will be +mapped to `fix` and `Story` will be mapped to `feat`. + +As a Jira story's description could be very long, you might not want to include the entire +description into change log. In that case, you may define `description_pattern` like above, +so that only content embraced with ` ... ` will be included. + +#### 3. Update the template to show Jira data. + +In the template, if a commit contains a Jira issue id, then you may show Jira data. For example: + +```markdown +{{ range .CommitGroups -}} +### {{ .Title }} +{{ range .Commits -}} +- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} +{{ if .JiraIssue }} {{ .JiraIssue.Description }} +{{ end }} +{{ end }} +{{ end -}} +``` + +Within a `Commit`, the following Jira data can be used in template: + +* `.JiraIssue.Summary` - Summary of the Jira story +* `.JiraIssue.Description` - Description of the Jira story +* `.JiraIssue.Type` - Original type of the Jira story, and `.Type` will be mapped type. +* `.JiraIssue.Labels` - A list of strings, each is a Jira label. + + ## FAQ
diff --git a/chglog.go b/chglog.go index d0afac53..968b65cf 100644 --- a/chglog.go +++ b/chglog.go @@ -16,25 +16,30 @@ import ( // Options is an option used to process commits type Options struct { - Processor Processor - NextTag string // Treat unreleased commits as specified tags (EXPERIMENTAL) - TagFilterPattern string // Filter tag by regexp - NoCaseSensitive bool // Filter commits in a case insensitive way - CommitFilters map[string][]string // Filter by using `Commit` properties and values. Filtering is not done by specifying an empty value - CommitSortBy string // Property name to use for sorting `Commit` (e.g. `Scope`) - CommitGroupBy string // Property name of `Commit` to be grouped into `CommitGroup` (e.g. `Type`) - CommitGroupSortBy string // Property name to use for sorting `CommitGroup` (e.g. `Title`) - CommitGroupTitleOrder []string // Predefined sorted list of titles to use for sorting `CommitGroup`. Only if `CommitGroupSortBy` is `Custom` - CommitGroupTitleMaps map[string]string // Map for `CommitGroup` title conversion - HeaderPattern string // A regular expression to use for parsing the commit header - HeaderPatternMaps []string // A rule for mapping the result of `HeaderPattern` to the property of `Commit` - IssuePrefix []string // Prefix used for issues (e.g. `#`, `gh-`) - RefActions []string // Word list of `Ref.Action` - MergePattern string // A regular expression to use for parsing the merge commit - MergePatternMaps []string // Similar to `HeaderPatternMaps` - RevertPattern string // A regular expression to use for parsing the revert commit - RevertPatternMaps []string // Similar to `HeaderPatternMaps` - NoteKeywords []string // Keyword list to find `Note`. A semicolon is a separator, like `:` (e.g. `BREAKING CHANGE`) + Processor Processor + NextTag string // Treat unreleased commits as specified tags (EXPERIMENTAL) + TagFilterPattern string // Filter tag by regexp + NoCaseSensitive bool // Filter commits in a case insensitive way + CommitFilters map[string][]string // Filter by using `Commit` properties and values. Filtering is not done by specifying an empty value + CommitSortBy string // Property name to use for sorting `Commit` (e.g. `Scope`) + CommitGroupBy string // Property name of `Commit` to be grouped into `CommitGroup` (e.g. `Type`) + CommitGroupSortBy string // Property name to use for sorting `CommitGroup` (e.g. `Title`) + CommitGroupTitleOrder []string // Predefined sorted list of titles to use for sorting `CommitGroup`. Only if `CommitGroupSortBy` is `Custom` + CommitGroupTitleMaps map[string]string // Map for `CommitGroup` title conversion + HeaderPattern string // A regular expression to use for parsing the commit header + HeaderPatternMaps []string // A rule for mapping the result of `HeaderPattern` to the property of `Commit` + IssuePrefix []string // Prefix used for issues (e.g. `#`, `gh-`) + RefActions []string // Word list of `Ref.Action` + MergePattern string // A regular expression to use for parsing the merge commit + MergePatternMaps []string // Similar to `HeaderPatternMaps` + RevertPattern string // A regular expression to use for parsing the revert commit + RevertPatternMaps []string // Similar to `HeaderPatternMaps` + NoteKeywords []string // Keyword list to find `Note`. A semicolon is a separator, like `:` (e.g. `BREAKING CHANGE`) + JiraUsername string + JiraToken string + JiraUrl string + JiraTypeMaps map[string]string + JiraIssueDescriptionPattern string } // Info is metadata related to CHANGELOG @@ -97,11 +102,13 @@ type Generator struct { } // NewGenerator receives `Config` and create an new `Generator` -func NewGenerator(config *Config) *Generator { +func NewGenerator(logger *Logger, config *Config) *Generator { client := gitcmd.New(&gitcmd.Config{ Bin: config.Bin, }) + jiraClient := NewJiraClient(config) + if config.Options.Processor != nil { config.Options.Processor.Bootstrap(config) } @@ -113,7 +120,7 @@ func NewGenerator(config *Config) *Generator { config: config, tagReader: newTagReader(client, config.Options.TagFilterPattern), tagSelector: newTagSelector(), - commitParser: newCommitParser(client, config), + commitParser: newCommitParser(logger, client, jiraClient, config), commitExtractor: newCommitExtractor(config.Options), } } diff --git a/chglog_test.go b/chglog_test.go index 7a1fd595..8e2a3e9e 100644 --- a/chglog_test.go +++ b/chglog_test.go @@ -76,15 +76,16 @@ func TestGeneratorNotFoundTags(t *testing.T) { commit("2018-01-01 00:00:00", "feat(*): New feature", "") }) - gen := NewGenerator(&Config{ - Bin: "git", - WorkingDir: filepath.Join(testRepoRoot, testName), - Template: filepath.Join(cwd, "testdata", testName+".md"), - Info: &Info{ - RepositoryURL: "https://github.com/git-chglog/git-chglog", - }, - Options: &Options{}, - }) + gen := NewGenerator(NewLogger(os.Stdout, os.Stderr, false, true), + &Config{ + Bin: "git", + WorkingDir: filepath.Join(testRepoRoot, testName), + Template: filepath.Join(cwd, "testdata", testName+".md"), + Info: &Info{ + RepositoryURL: "https://github.com/git-chglog/git-chglog", + }, + Options: &Options{}, + }) buf := &bytes.Buffer{} err := gen.Generate(buf, "") @@ -102,15 +103,16 @@ func TestGeneratorNotFoundCommits(t *testing.T) { tag("1.0.0") }) - gen := NewGenerator(&Config{ - Bin: "git", - WorkingDir: filepath.Join(testRepoRoot, testName), - Template: filepath.Join(cwd, "testdata", testName+".md"), - Info: &Info{ - RepositoryURL: "https://github.com/git-chglog/git-chglog", - }, - Options: &Options{}, - }) + gen := NewGenerator(NewLogger(os.Stdout, os.Stderr, false, true), + &Config{ + Bin: "git", + WorkingDir: filepath.Join(testRepoRoot, testName), + Template: filepath.Join(cwd, "testdata", testName+".md"), + Info: &Info{ + RepositoryURL: "https://github.com/git-chglog/git-chglog", + }, + Options: &Options{}, + }) buf := &bytes.Buffer{} err := gen.Generate(buf, "foo") @@ -127,44 +129,45 @@ func TestGeneratorNotFoundCommitsOne(t *testing.T) { tag("1.0.0") }) - gen := NewGenerator(&Config{ - Bin: "git", - WorkingDir: filepath.Join(testRepoRoot, testName), - Template: filepath.Join(cwd, "testdata", testName+".md"), - Info: &Info{ - RepositoryURL: "https://github.com/git-chglog/git-chglog", - }, - Options: &Options{ - CommitFilters: map[string][]string{}, - CommitSortBy: "Scope", - CommitGroupBy: "Type", - CommitGroupSortBy: "Title", - CommitGroupTitleMaps: map[string]string{}, - HeaderPattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$", - HeaderPatternMaps: []string{ - "Type", - "Scope", - "Subject", + gen := NewGenerator(NewLogger(os.Stdout, os.Stderr, false, true), + &Config{ + Bin: "git", + WorkingDir: filepath.Join(testRepoRoot, testName), + Template: filepath.Join(cwd, "testdata", testName+".md"), + Info: &Info{ + RepositoryURL: "https://github.com/git-chglog/git-chglog", }, - IssuePrefix: []string{ - "#", - "gh-", + Options: &Options{ + CommitFilters: map[string][]string{}, + CommitSortBy: "Scope", + CommitGroupBy: "Type", + CommitGroupSortBy: "Title", + CommitGroupTitleMaps: map[string]string{}, + HeaderPattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$", + HeaderPatternMaps: []string{ + "Type", + "Scope", + "Subject", + }, + IssuePrefix: []string{ + "#", + "gh-", + }, + RefActions: []string{}, + MergePattern: "^Merge pull request #(\\d+) from (.*)$", + MergePatternMaps: []string{ + "Ref", + "Source", + }, + RevertPattern: "^Revert \"([\\s\\S]*)\"$", + RevertPatternMaps: []string{ + "Header", + }, + NoteKeywords: []string{ + "BREAKING CHANGE", + }, }, - RefActions: []string{}, - MergePattern: "^Merge pull request #(\\d+) from (.*)$", - MergePatternMaps: []string{ - "Ref", - "Source", - }, - RevertPattern: "^Revert \"([\\s\\S]*)\"$", - RevertPatternMaps: []string{ - "Header", - }, - NoteKeywords: []string{ - "BREAKING CHANGE", - }, - }, - }) + }) buf := &bytes.Buffer{} err := gen.Generate(buf, "foo") @@ -202,53 +205,54 @@ change message.`) commit("2018-01-04 00:01:00", "fix(core): Fix commit\n\nThis is body message.", "") }) - gen := NewGenerator(&Config{ - Bin: "git", - WorkingDir: filepath.Join(testRepoRoot, testName), - Template: filepath.Join(cwd, "testdata", testName+".md"), - Info: &Info{ - Title: "CHANGELOG Example", - RepositoryURL: "https://github.com/git-chglog/git-chglog", - }, - Options: &Options{ - CommitFilters: map[string][]string{ - "Type": []string{ - "feat", - "fix", + gen := NewGenerator(NewLogger(os.Stdout, os.Stderr, false, true), + &Config{ + Bin: "git", + WorkingDir: filepath.Join(testRepoRoot, testName), + Template: filepath.Join(cwd, "testdata", testName+".md"), + Info: &Info{ + Title: "CHANGELOG Example", + RepositoryURL: "https://github.com/git-chglog/git-chglog", + }, + Options: &Options{ + CommitFilters: map[string][]string{ + "Type": []string{ + "feat", + "fix", + }, + }, + CommitSortBy: "Scope", + CommitGroupBy: "Type", + CommitGroupSortBy: "Title", + CommitGroupTitleMaps: map[string]string{ + "feat": "Features", + "fix": "Bug Fixes", + }, + HeaderPattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$", + HeaderPatternMaps: []string{ + "Type", + "Scope", + "Subject", + }, + IssuePrefix: []string{ + "#", + "gh-", + }, + RefActions: []string{}, + MergePattern: "^Merge pull request #(\\d+) from (.*)$", + MergePatternMaps: []string{ + "Ref", + "Source", + }, + RevertPattern: "^Revert \"([\\s\\S]*)\"$", + RevertPatternMaps: []string{ + "Header", + }, + NoteKeywords: []string{ + "BREAKING CHANGE", }, }, - CommitSortBy: "Scope", - CommitGroupBy: "Type", - CommitGroupSortBy: "Title", - CommitGroupTitleMaps: map[string]string{ - "feat": "Features", - "fix": "Bug Fixes", - }, - HeaderPattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$", - HeaderPatternMaps: []string{ - "Type", - "Scope", - "Subject", - }, - IssuePrefix: []string{ - "#", - "gh-", - }, - RefActions: []string{}, - MergePattern: "^Merge pull request #(\\d+) from (.*)$", - MergePatternMaps: []string{ - "Ref", - "Source", - }, - RevertPattern: "^Revert \"([\\s\\S]*)\"$", - RevertPatternMaps: []string{ - "Header", - }, - NoteKeywords: []string{ - "BREAKING CHANGE", - }, - }, - }) + }) buf := &bytes.Buffer{} err := gen.Generate(buf, "") @@ -315,35 +319,36 @@ func TestGeneratorWithNextTag(t *testing.T) { commit("2018-03-01 00:00:00", "feat(core): version 3.0.0", "") }) - gen := NewGenerator(&Config{ - Bin: "git", - WorkingDir: filepath.Join(testRepoRoot, testName), - Template: filepath.Join(cwd, "testdata", testName+".md"), - Info: &Info{ - Title: "CHANGELOG Example", - RepositoryURL: "https://github.com/git-chglog/git-chglog", - }, - Options: &Options{ - NextTag: "3.0.0", - CommitFilters: map[string][]string{ - "Type": []string{ - "feat", + gen := NewGenerator(NewLogger(os.Stdout, os.Stderr, false, true), + &Config{ + Bin: "git", + WorkingDir: filepath.Join(testRepoRoot, testName), + Template: filepath.Join(cwd, "testdata", testName+".md"), + Info: &Info{ + Title: "CHANGELOG Example", + RepositoryURL: "https://github.com/git-chglog/git-chglog", + }, + Options: &Options{ + NextTag: "3.0.0", + CommitFilters: map[string][]string{ + "Type": []string{ + "feat", + }, + }, + CommitSortBy: "Scope", + CommitGroupBy: "Type", + CommitGroupSortBy: "Title", + CommitGroupTitleMaps: map[string]string{ + "feat": "Features", + }, + HeaderPattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$", + HeaderPatternMaps: []string{ + "Type", + "Scope", + "Subject", }, }, - CommitSortBy: "Scope", - CommitGroupBy: "Type", - CommitGroupSortBy: "Title", - CommitGroupTitleMaps: map[string]string{ - "feat": "Features", - }, - HeaderPattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$", - HeaderPatternMaps: []string{ - "Type", - "Scope", - "Subject", - }, - }, - }) + }) buf := &bytes.Buffer{} err := gen.Generate(buf, "") @@ -407,35 +412,36 @@ func TestGeneratorWithTagFiler(t *testing.T) { tag("v1.0.0") }) - gen := NewGenerator(&Config{ - Bin: "git", - WorkingDir: filepath.Join(testRepoRoot, testName), - Template: filepath.Join(cwd, "testdata", testName+".md"), - Info: &Info{ - Title: "CHANGELOG Example", - RepositoryURL: "https://github.com/git-chglog/git-chglog", - }, - Options: &Options{ - TagFilterPattern: "^v", - CommitFilters: map[string][]string{ - "Type": []string{ - "feat", + gen := NewGenerator(NewLogger(os.Stdout, os.Stderr, false, true), + &Config{ + Bin: "git", + WorkingDir: filepath.Join(testRepoRoot, testName), + Template: filepath.Join(cwd, "testdata", testName+".md"), + Info: &Info{ + Title: "CHANGELOG Example", + RepositoryURL: "https://github.com/git-chglog/git-chglog", + }, + Options: &Options{ + TagFilterPattern: "^v", + CommitFilters: map[string][]string{ + "Type": []string{ + "feat", + }, + }, + CommitSortBy: "Scope", + CommitGroupBy: "Type", + CommitGroupSortBy: "Title", + CommitGroupTitleMaps: map[string]string{ + "feat": "Features", + }, + HeaderPattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$", + HeaderPatternMaps: []string{ + "Type", + "Scope", + "Subject", }, }, - CommitSortBy: "Scope", - CommitGroupBy: "Type", - CommitGroupSortBy: "Title", - CommitGroupTitleMaps: map[string]string{ - "feat": "Features", - }, - HeaderPattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$", - HeaderPatternMaps: []string{ - "Type", - "Scope", - "Subject", - }, - }, - }) + }) buf := &bytes.Buffer{} err := gen.Generate(buf, "") diff --git a/cmd/git-chglog/cli.go b/cmd/git-chglog/cli.go index dcb44b60..2f2b4c1b 100644 --- a/cmd/git-chglog/cli.go +++ b/cmd/git-chglog/cli.go @@ -14,7 +14,7 @@ import ( type CLI struct { ctx *CLIContext fs FileSystem - logger *Logger + logger *chglog.Logger configLoader ConfigLoader generator Generator processorFactory *ProcessorFactory @@ -34,7 +34,7 @@ func NewCLI( return &CLI{ ctx: ctx, fs: fs, - logger: NewLogger(ctx.Stdout, ctx.Stderr, silent, ctx.NoEmoji), + logger: chglog.NewLogger(ctx.Stdout, ctx.Stderr, silent, ctx.NoEmoji), configLoader: configLoader, generator: generator, processorFactory: NewProcessorFactory(), @@ -69,7 +69,7 @@ func (c *CLI) Run() int { return ExitCodeError } - err = c.generator.Generate(w, c.ctx.Query, changelogConfig) + err = c.generator.Generate(c.logger, w, c.ctx.Query, changelogConfig) if err != nil { c.logger.Error(err.Error()) return ExitCodeError diff --git a/cmd/git-chglog/config.go b/cmd/git-chglog/config.go index 7baeca4a..d2e4844d 100644 --- a/cmd/git-chglog/config.go +++ b/cmd/git-chglog/config.go @@ -49,6 +49,24 @@ type NoteOptions struct { Keywords []string `yaml:"keywords"` } +type JiraClientInfoOptions struct { + Username string `yaml:"username"` + Token string `yaml:"token"` + URL string `yaml:"url"` +} + +// JiraIssueOptions ... +type JiraIssueOptions struct { + TypeMaps map[string]string `yaml:"type_maps"` + DescriptionPattern string `yaml:"description_pattern"` +} + +// JiraOptions ... +type JiraOptions struct { + ClintInfo JiraClientInfoOptions `yaml:"info"` + Issue JiraIssueOptions `yaml:"issue"` +} + // Options ... type Options struct { TagFilterPattern string `yaml:"tag_filter_pattern"` @@ -60,6 +78,7 @@ type Options struct { Merges PatternOptions `yaml:"merges"` Reverts PatternOptions `yaml:"reverts"` Notes NoteOptions `yaml:"notes"` + Jira JiraOptions `yaml:"jira"` } // Config ... @@ -245,6 +264,13 @@ func (config *Config) normalizeStyleOfBitbucket() { config.Options = opts } +func orValue(str1 string, str2 string) string { + if str1 != "" { + return str1 + } + return str2 +} + // Convert ... func (config *Config) Convert(ctx *CLIContext) *chglog.Config { info := config.Info @@ -257,30 +283,34 @@ func (config *Config) Convert(ctx *CLIContext) *chglog.Config { return &chglog.Config{ Bin: config.Bin, WorkingDir: ctx.WorkingDir, - Template: config.Template, + Template: orValue(ctx.Template, config.Template), Info: &chglog.Info{ Title: info.Title, - RepositoryURL: info.RepositoryURL, + RepositoryURL: orValue(ctx.RepositoryUrl, info.RepositoryURL), }, Options: &chglog.Options{ - NextTag: ctx.NextTag, - TagFilterPattern: ctx.TagFilterPattern, - NoCaseSensitive: ctx.NoCaseSensitive, - CommitFilters: opts.Commits.Filters, - CommitSortBy: opts.Commits.SortBy, - CommitGroupBy: opts.CommitGroups.GroupBy, - CommitGroupSortBy: opts.CommitGroups.SortBy, - CommitGroupTitleMaps: opts.CommitGroups.TitleMaps, - CommitGroupTitleOrder: opts.CommitGroups.TitleOrder, - HeaderPattern: opts.Header.Pattern, - HeaderPatternMaps: opts.Header.PatternMaps, - IssuePrefix: opts.Issues.Prefix, - RefActions: opts.Refs.Actions, - MergePattern: opts.Merges.Pattern, - MergePatternMaps: opts.Merges.PatternMaps, - RevertPattern: opts.Reverts.Pattern, - RevertPatternMaps: opts.Reverts.PatternMaps, - NoteKeywords: opts.Notes.Keywords, + NextTag: ctx.NextTag, + TagFilterPattern: ctx.TagFilterPattern, + NoCaseSensitive: ctx.NoCaseSensitive, + CommitFilters: opts.Commits.Filters, + CommitSortBy: opts.Commits.SortBy, + CommitGroupBy: opts.CommitGroups.GroupBy, + CommitGroupSortBy: opts.CommitGroups.SortBy, + CommitGroupTitleMaps: opts.CommitGroups.TitleMaps, + HeaderPattern: opts.Header.Pattern, + HeaderPatternMaps: opts.Header.PatternMaps, + IssuePrefix: opts.Issues.Prefix, + RefActions: opts.Refs.Actions, + MergePattern: opts.Merges.Pattern, + MergePatternMaps: opts.Merges.PatternMaps, + RevertPattern: opts.Reverts.Pattern, + RevertPatternMaps: opts.Reverts.PatternMaps, + NoteKeywords: opts.Notes.Keywords, + JiraUsername: orValue(ctx.JiraUsername, opts.Jira.ClintInfo.Username), + JiraToken: orValue(ctx.JiraToken, opts.Jira.ClintInfo.Token), + JiraUrl: orValue(ctx.JiraUrl, opts.Jira.ClintInfo.URL), + JiraTypeMaps: opts.Jira.Issue.TypeMaps, + JiraIssueDescriptionPattern: opts.Jira.Issue.DescriptionPattern, }, } } diff --git a/cmd/git-chglog/context.go b/cmd/git-chglog/context.go index a33cc6d9..3f2e1aa8 100644 --- a/cmd/git-chglog/context.go +++ b/cmd/git-chglog/context.go @@ -10,6 +10,8 @@ type CLIContext struct { Stdout io.Writer Stderr io.Writer ConfigPath string + Template string + RepositoryUrl string OutputPath string Silent bool NoColor bool @@ -18,6 +20,9 @@ type CLIContext struct { Query string NextTag string TagFilterPattern string + JiraUsername string + JiraToken string + JiraUrl string } // InitContext ... diff --git a/cmd/git-chglog/generator.go b/cmd/git-chglog/generator.go index be229a33..583ea5d7 100644 --- a/cmd/git-chglog/generator.go +++ b/cmd/git-chglog/generator.go @@ -8,7 +8,7 @@ import ( // Generator ... type Generator interface { - Generate(io.Writer, string, *chglog.Config) error + Generate(*chglog.Logger, io.Writer, string, *chglog.Config) error } type generatorImpl struct{} @@ -19,6 +19,6 @@ func NewGenerator() Generator { } // Generate ... -func (*generatorImpl) Generate(w io.Writer, query string, config *chglog.Config) error { - return chglog.NewGenerator(config).Generate(w, query) +func (*generatorImpl) Generate(logger *chglog.Logger, w io.Writer, query string, config *chglog.Config) error { + return chglog.NewGenerator(logger, config).Generate(w, query) } diff --git a/cmd/git-chglog/generator_mock.go b/cmd/git-chglog/generator_mock.go index 467c7d31..5120c995 100644 --- a/cmd/git-chglog/generator_mock.go +++ b/cmd/git-chglog/generator_mock.go @@ -10,6 +10,6 @@ type mockGeneratorImpl struct { ReturnGenerate func(io.Writer, string, *chglog.Config) error } -func (m *mockGeneratorImpl) Generate(w io.Writer, query string, config *chglog.Config) error { +func (m *mockGeneratorImpl) Generate(logger *chglog.Logger, w io.Writer, query string, config *chglog.Config) error { return m.ReturnGenerate(w, query, config) } diff --git a/cmd/git-chglog/initializer.go b/cmd/git-chglog/initializer.go index 7356f8b0..c0a8489a 100644 --- a/cmd/git-chglog/initializer.go +++ b/cmd/git-chglog/initializer.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "github.com/git-chglog/git-chglog" "path/filepath" "github.com/fatih/color" @@ -13,7 +14,7 @@ type Initializer struct { ctx *InitContext client gitcmd.Client fs FileSystem - logger *Logger + logger *chglog.Logger questioner Questioner configBuilder ConfigBuilder templateBuilderFactory TemplateBuilderFactory @@ -29,7 +30,7 @@ func NewInitializer( return &Initializer{ ctx: ctx, fs: fs, - logger: NewLogger(ctx.Stdout, ctx.Stderr, false, false), + logger: chglog.NewLogger(ctx.Stdout, ctx.Stderr, false, false), questioner: questioner, configBuilder: configBuilder, templateBuilderFactory: tplBuilderFactory, diff --git a/cmd/git-chglog/main.go b/cmd/git-chglog/main.go index 6f262476..28005207 100644 --- a/cmd/git-chglog/main.go +++ b/cmd/git-chglog/main.go @@ -83,6 +83,18 @@ func CreateApp(actionFunc cli.ActionFunc) *cli.App { Value: ".chglog/config.yml", }, + // template + &cli.StringFlag{ + Name: "template, t", + Usage: "specifies a template file to pick up. If not specified, use the one in config", + }, + + // repository url + &cli.StringFlag{ + Name: "repository-url", + Usage: "specifies git repo URL. If not specified, use 'repository_url' in config", + }, + // output &cli.StringFlag{ Name: "output, o", @@ -102,15 +114,15 @@ func CreateApp(actionFunc cli.ActionFunc) *cli.App { // no-color &cli.BoolFlag{ - Name: "no-color", - Usage: "disable color output", + Name: "no-color", + Usage: "disable color output", EnvVars: []string{"NO_COLOR"}, }, // no-emoji &cli.BoolFlag{ - Name: "no-emoji", - Usage: "disable emoji output", + Name: "no-emoji", + Usage: "disable emoji output", EnvVars: []string{"NO_EMOJI"}, }, @@ -122,10 +134,31 @@ func CreateApp(actionFunc cli.ActionFunc) *cli.App { // tag-filter-pattern &cli.StringFlag{ - Name: "tag-filter-pattern, p", + Name: "tag-filter-pattern", Usage: "Regular expression of tag filter. Is specified, only matched tags will be picked", }, + // jira-url + &cli.StringFlag{ + Name: "jira-url", + Usage: "Jira URL", + EnvVars: []string{"JIRA_URL"}, + }, + + // jira-username + &cli.StringFlag{ + Name: "jira-username", + Usage: "Jira username", + EnvVars: []string{"JIRA_USERNAME"}, + }, + + // jira-token + &cli.StringFlag{ + Name: "jira-token", + Usage: "Jira token", + EnvVars: []string{"JIRA_TOKEN"}, + }, + // help & version cli.HelpFlag, cli.VersionFlag, @@ -180,6 +213,9 @@ func AppAction(c *cli.Context) error { Query: c.Args().First(), NextTag: c.String("next-tag"), TagFilterPattern: c.String("tag-filter-pattern"), + JiraUsername: c.String("jira-username"), + JiraToken: c.String("jira-token"), + JiraUrl: c.String("jira-url"), }, fs, NewConfigLoader(), diff --git a/commit_parser.go b/commit_parser.go index 5054b227..83d38a45 100644 --- a/commit_parser.go +++ b/commit_parser.go @@ -1,12 +1,13 @@ package chglog import ( + "fmt" "regexp" "strconv" "strings" "time" - gitcmd "github.com/tsuyoshiwada/go-gitcmd" + "github.com/tsuyoshiwada/go-gitcmd" ) var ( @@ -47,18 +48,21 @@ func joinAndQuoteMeta(list []string, sep string) string { } type commitParser struct { - client gitcmd.Client - config *Config - reHeader *regexp.Regexp - reMerge *regexp.Regexp - reRevert *regexp.Regexp - reRef *regexp.Regexp - reIssue *regexp.Regexp - reNotes *regexp.Regexp - reMention *regexp.Regexp + logger *Logger + client gitcmd.Client + jiraClient JiraClient + config *Config + reHeader *regexp.Regexp + reMerge *regexp.Regexp + reRevert *regexp.Regexp + reRef *regexp.Regexp + reIssue *regexp.Regexp + reNotes *regexp.Regexp + reMention *regexp.Regexp + reJiraIssueDescription *regexp.Regexp } -func newCommitParser(client gitcmd.Client, config *Config) *commitParser { +func newCommitParser(logger *Logger, client gitcmd.Client, jiraClient JiraClient, config *Config) *commitParser { opts := config.Options joinedRefActions := joinAndQuoteMeta(opts.RefActions, "|") @@ -66,15 +70,18 @@ func newCommitParser(client gitcmd.Client, config *Config) *commitParser { joinedNoteKeywords := joinAndQuoteMeta(opts.NoteKeywords, "|") return &commitParser{ - client: client, - config: config, - reHeader: regexp.MustCompile(opts.HeaderPattern), - reMerge: regexp.MustCompile(opts.MergePattern), - reRevert: regexp.MustCompile(opts.RevertPattern), - reRef: regexp.MustCompile("(?i)(" + joinedRefActions + ")\\s?([\\w/\\.\\-]+)?(?:" + joinedIssuePrefix + ")(\\d+)"), - reIssue: regexp.MustCompile("(?:" + joinedIssuePrefix + ")(\\d+)"), - reNotes: regexp.MustCompile("^(?i)\\s*(" + joinedNoteKeywords + ")[:\\s]+(.*)"), - reMention: regexp.MustCompile("@([\\w-]+)"), + logger: logger, + client: client, + jiraClient: jiraClient, + config: config, + reHeader: regexp.MustCompile(opts.HeaderPattern), + reMerge: regexp.MustCompile(opts.MergePattern), + reRevert: regexp.MustCompile(opts.RevertPattern), + reRef: regexp.MustCompile("(?i)(" + joinedRefActions + ")\\s?([\\w/\\.\\-]+)?(?:" + joinedIssuePrefix + ")(\\d+)"), + reIssue: regexp.MustCompile("(?:" + joinedIssuePrefix + ")(\\d+)"), + reNotes: regexp.MustCompile("^(?i)\\s*(" + joinedNoteKeywords + ")[:\\s]+(.*)"), + reMention: regexp.MustCompile("@([\\w-]+)"), + reJiraIssueDescription: regexp.MustCompile(opts.JiraIssueDescriptionPattern), } } @@ -206,6 +213,11 @@ func (p *commitParser) processHeader(commit *Commit, input string) { // refs & mentions commit.Refs = p.parseRefs(input) commit.Mentions = p.parseMentions(input) + + // Jira + if commit.JiraIssueId != "" { + p.processJiraIssue(commit, commit.JiraIssueId) + } } func (p *commitParser) processBody(commit *Commit, input string) { @@ -344,6 +356,28 @@ func (p *commitParser) uniqMentions(mentions []string) []string { return arr } +func (p *commitParser) processJiraIssue(commit *Commit, issueId string) { + issue, err := p.jiraClient.GetJiraIssue(commit.JiraIssueId) + if err != nil { + p.logger.Error(fmt.Sprintf("Failed to parse Jira story %s: %s\n", issueId, err)) + return + } + commit.Type = p.config.Options.JiraTypeMaps[issue.Fields.Type.Name] + commit.JiraIssue = &JiraIssue{ + Type: issue.Fields.Type.Name, + Summary: issue.Fields.Summary, + Description: issue.Fields.Description, + Labels: issue.Fields.Labels, + } + + if p.config.Options.JiraIssueDescriptionPattern != "" { + res := p.reJiraIssueDescription.FindStringSubmatch(commit.JiraIssue.Description) + if len(res) > 1 { + commit.JiraIssue.Description = res[1] + } + } +} + var ( fenceTypes = []string{ "```", diff --git a/commit_parser_test.go b/commit_parser_test.go index 2df79531..defc7357 100644 --- a/commit_parser_test.go +++ b/commit_parser_test.go @@ -4,10 +4,12 @@ import ( "errors" "fmt" "io/ioutil" + "os" "path/filepath" "testing" "time" + agjira "github.com/andygrunwald/go-jira" "github.com/stretchr/testify/assert" ) @@ -27,51 +29,52 @@ func TestCommitParserParse(t *testing.T) { }, } - parser := newCommitParser(mock, &Config{ - Options: &Options{ - CommitFilters: map[string][]string{ - "Type": []string{ - "feat", + parser := newCommitParser(NewLogger(os.Stdout, os.Stderr, false, true), + mock, nil, &Config{ + Options: &Options{ + CommitFilters: map[string][]string{ + "Type": []string{ + "feat", + "fix", + "perf", + "refactor", + }, + }, + HeaderPattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$", + HeaderPatternMaps: []string{ + "Type", + "Scope", + "Subject", + }, + IssuePrefix: []string{ + "#", + "gh-", + }, + RefActions: []string{ + "close", + "closes", + "closed", "fix", - "perf", - "refactor", + "fixes", + "fixed", + "resolve", + "resolves", + "resolved", + }, + MergePattern: "^Merge pull request #(\\d+) from (.*)$", + MergePatternMaps: []string{ + "Ref", + "Source", + }, + RevertPattern: "^Revert \"([\\s\\S]*)\"$", + RevertPatternMaps: []string{ + "Header", + }, + NoteKeywords: []string{ + "BREAKING CHANGE", }, }, - HeaderPattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$", - HeaderPatternMaps: []string{ - "Type", - "Scope", - "Subject", - }, - IssuePrefix: []string{ - "#", - "gh-", - }, - RefActions: []string{ - "close", - "closes", - "closed", - "fix", - "fixes", - "fixed", - "resolve", - "resolves", - "resolved", - }, - MergePattern: "^Merge pull request #(\\d+) from (.*)$", - MergePatternMaps: []string{ - "Ref", - "Source", - }, - RevertPattern: "^Revert \"([\\s\\S]*)\"$", - RevertPatternMaps: []string{ - "Header", - }, - NoteKeywords: []string{ - "BREAKING CHANGE", - }, - }, - }) + }) commits, err := parser.Parse("HEAD") assert.Nil(err) @@ -308,3 +311,102 @@ Closes username/repository#456`, "```", "```"), }, }, commits) } + +type mockJiraClient struct { +} + +func (jira mockJiraClient) GetJiraIssue(id string) (*agjira.Issue, error) { + return &agjira.Issue{ + ID: id, + Fields: &agjira.IssueFields{ + Expand: "", + Type: agjira.IssueType{Name: "Story"}, + Project: agjira.Project{}, + Resolution: nil, + Priority: nil, + Resolutiondate: agjira.Time{}, + Created: agjira.Time{}, + Duedate: agjira.Date{}, + Watches: nil, + Assignee: nil, + Updated: agjira.Time{}, + Description: fmt.Sprintf("description of %s", id), + Summary: fmt.Sprintf("summary of %s", id), + Creator: nil, + Reporter: nil, + Components: nil, + Status: nil, + Progress: nil, + AggregateProgress: nil, + TimeTracking: nil, + TimeSpent: 0, + TimeEstimate: 0, + TimeOriginalEstimate: 0, + Worklog: nil, + IssueLinks: nil, + Comments: nil, + FixVersions: nil, + AffectsVersions: nil, + Labels: []string{"GA"}, + Subtasks: nil, + Attachments: nil, + Epic: nil, + Sprint: nil, + Parent: nil, + AggregateTimeOriginalEstimate: 0, + AggregateTimeSpent: 0, + AggregateTimeEstimate: 0, + Unknowns: nil, + }, + }, nil +} + +func TestCommitParserParseWithJira(t *testing.T) { + assert := assert.New(t) + assert.True(true) + + mock := &mockClient{ + ReturnExec: func(subcmd string, args ...string) (string, error) { + if subcmd != "log" { + return "", errors.New("") + } + + bytes, _ := ioutil.ReadFile(filepath.Join("testdata", "gitlog_jira.txt")) + + return string(bytes), nil + }, + } + + parser := newCommitParser(NewLogger(os.Stdout, os.Stderr, false, true), + mock, mockJiraClient{}, &Config{ + Options: &Options{ + CommitFilters: map[string][]string{ + "Type": []string{ + "feat", + "fix", + "perf", + "refactor", + }, + }, + HeaderPattern: "^(?:(\\w*)|(?:\\[(.*)\\])?)\\:\\s(.*)$", + HeaderPatternMaps: []string{ + "Type", + "JiraIssueId", + "Subject", + }, + JiraTypeMaps: map[string]string{ + "Story": "feat", + }, + }, + }) + + commits, err := parser.Parse("HEAD") + assert.Nil(err) + commit := commits[0] + assert.Equal(commit.JiraIssueId, "JIRA-1111") + assert.Equal(commit.JiraIssue.Type, "Story") + assert.Equal(commit.JiraIssue.Summary, "summary of JIRA-1111") + assert.Equal(commit.JiraIssue.Description, "description of JIRA-1111") + assert.Equal(commit.JiraIssue.Labels, []string{"GA"}) + assert.Equal(commit.Type, "feat") +} diff --git a/example_test.go b/example_test.go index fd0f1adb..931b3bb1 100644 --- a/example_test.go +++ b/example_test.go @@ -4,56 +4,58 @@ import ( "bytes" "fmt" "log" + "os" ) func Example() { - gen := NewGenerator(&Config{ - Bin: "git", - WorkingDir: ".", - Template: "CHANGELOG.tpl.md", - Info: &Info{ - Title: "CHANGELOG", - RepositoryURL: "https://github.com/git-chglog/git-chglog", - }, - Options: &Options{ - CommitFilters: map[string][]string{ - "Type": []string{ - "feat", - "fix", + gen := NewGenerator(NewLogger(os.Stdout, os.Stderr, false, true), + &Config{ + Bin: "git", + WorkingDir: ".", + Template: "CHANGELOG.tpl.md", + Info: &Info{ + Title: "CHANGELOG", + RepositoryURL: "https://github.com/git-chglog/git-chglog", + }, + Options: &Options{ + CommitFilters: map[string][]string{ + "Type": []string{ + "feat", + "fix", + }, + }, + CommitSortBy: "Scope", + CommitGroupBy: "Type", + CommitGroupSortBy: "Title", + CommitGroupTitleMaps: map[string]string{ + "feat": "Features", + "fix": "Bug Fixes", + }, + HeaderPattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$", + HeaderPatternMaps: []string{ + "Type", + "Scope", + "Subject", + }, + IssuePrefix: []string{ + "#", + "gh-", + }, + RefActions: []string{}, + MergePattern: "^Merge pull request #(\\d+) from (.*)$", + MergePatternMaps: []string{ + "Ref", + "Source", + }, + RevertPattern: "^Revert \"([\\s\\S]*)\"$", + RevertPatternMaps: []string{ + "Header", + }, + NoteKeywords: []string{ + "BREAKING CHANGE", }, }, - CommitSortBy: "Scope", - CommitGroupBy: "Type", - CommitGroupSortBy: "Title", - CommitGroupTitleMaps: map[string]string{ - "feat": "Features", - "fix": "Bug Fixes", - }, - HeaderPattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$", - HeaderPatternMaps: []string{ - "Type", - "Scope", - "Subject", - }, - IssuePrefix: []string{ - "#", - "gh-", - }, - RefActions: []string{}, - MergePattern: "^Merge pull request #(\\d+) from (.*)$", - MergePatternMaps: []string{ - "Ref", - "Source", - }, - RevertPattern: "^Revert \"([\\s\\S]*)\"$", - RevertPatternMaps: []string{ - "Header", - }, - NoteKeywords: []string{ - "BREAKING CHANGE", - }, - }, - }) + }) buf := &bytes.Buffer{} err := gen.Generate(buf, "") diff --git a/fields.go b/fields.go index 46cf8cc3..123da6c7 100644 --- a/fields.go +++ b/fields.go @@ -52,21 +52,31 @@ type NoteGroup struct { Notes []*Note } +// JiraIssue +type JiraIssue struct { + Type string + Summary string + Description string + Labels []string +} + // Commit data type Commit struct { - Hash *Hash - Author *Author - Committer *Committer - Merge *Merge // If it is not a merge commit, `nil` is assigned - Revert *Revert // If it is not a revert commit, `nil` is assigned - Refs []*Ref - Notes []*Note - Mentions []string // Name of the user included in the commit header or body - Header string // (e.g. `feat(core): Add new feature`) - Type string // (e.g. `feat`) - Scope string // (e.g. `core`) - Subject string // (e.g. `Add new feature`) - Body string + Hash *Hash + Author *Author + Committer *Committer + Merge *Merge // If it is not a merge commit, `nil` is assigned + Revert *Revert // If it is not a revert commit, `nil` is assigned + Refs []*Ref + Notes []*Note + Mentions []string // Name of the user included in the commit header or body + JiraIssue *JiraIssue // If no issue id found in header, `nil` is assigned + Header string // (e.g. `feat(core)[RNWY-310]: Add new feature`) + Type string // (e.g. `feat`) + Scope string // (e.g. `core`) + Subject string // (e.g. `Add new feature`) + JiraIssueId string // (e.g. `RNWY-310`) + Body string } // CommitGroup is a collection of commits grouped according to the `CommitGroupBy` option diff --git a/go.mod b/go.mod index 4f0140ec..daef7e59 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.15 require ( github.com/AlecAivazis/survey/v2 v2.2.8 + github.com/andygrunwald/go-jira v1.13.0 github.com/fatih/color v1.10.0 github.com/imdario/mergo v0.3.11 github.com/kyokomi/emoji/v2 v2.2.8 diff --git a/go.sum b/go.sum index de399e24..e141f10b 100644 --- a/go.sum +++ b/go.sum @@ -3,13 +3,23 @@ github.com/AlecAivazis/survey/v2 v2.2.8/go.mod h1:9DYvHgXtiXm6nCn+jXnOXLKbH+Yo9u github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8 h1:xzYJEypr/85nBpB11F9br+3HUrpgb+fcm5iADzXXYEw= github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc= +github.com/andygrunwald/go-jira v1.13.0 h1:vvIImGgX32bHfoiyUwkNo+/YrPnRczNarvhLOncP6dE= +github.com/andygrunwald/go-jira v1.13.0/go.mod h1:jYi4kFDbRPZTJdJOVJO4mpMMIwdB+rcZwSO58DzPd2I= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/structs v1.0.0 h1:BrX964Rv5uQ3wwS+KRUAJCBBw5PQmgJfJ6v4yly5QwU= +github.com/fatih/structs v1.0.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 h1:zLTLjkaOFEFIOxY5BWLFLwh+cL8vOBW4XJ2aqLE/Tf0= +github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174 h1:WlZsjVhE8Af9IcZDGgJGQpNflI3+MJSBhsgT5PCtzBQ= github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= @@ -28,6 +38,8 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= +github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= @@ -38,11 +50,14 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/trivago/tgo v1.0.1 h1:bxatjJIXNIpV18bucU4Uk/LaoxvxuOlp/oowRHyncLQ= +github.com/trivago/tgo v1.0.1/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkFnhc= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df h1:Y2l28Jr3vOEeYtxfVbMtVfOdAwuUqWaP9fvNKiBVeXY= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df/go.mod h1:pnyouUty/nBr/zm3GYwTIt+qFTLWbdjeLjZmJdzJOu8= github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 h1:8dUaAV7K4uHsF56JQWkprecIQKdPHtR9jCHF5nB8uzc= golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= diff --git a/jira.go b/jira.go new file mode 100644 index 00000000..78afbdd7 --- /dev/null +++ b/jira.go @@ -0,0 +1,36 @@ +package chglog + +import ( + agjira "github.com/andygrunwald/go-jira" +) + +type JiraClient interface { + GetJiraIssue(id string) (*agjira.Issue, error) +} + +type jiraClient struct { + username string + token string + url string +} + +func NewJiraClient(config *Config) JiraClient { + return jiraClient{ + username: config.Options.JiraUsername, + token: config.Options.JiraToken, + url: config.Options.JiraUrl, + } +} + +func (jira jiraClient) GetJiraIssue(id string) (*agjira.Issue, error) { + tp := agjira.BasicAuthTransport{ + Username: jira.username, + Password: jira.token, + } + client, err := agjira.NewClient(tp.Client(), jira.url) + if err != nil { + return nil, err + } + issue, _, err := client.Issue.Get(id, nil) + return issue, err +} diff --git a/jira_test.go b/jira_test.go new file mode 100644 index 00000000..30936e29 --- /dev/null +++ b/jira_test.go @@ -0,0 +1,42 @@ +package chglog + +import ( + "github.com/stretchr/testify/assert" + "testing" +) + +func TestJira(t *testing.T) { + assert := assert.New(t) + + config := &Config { + Options: &Options{ + Processor: nil, + NextTag: "", + TagFilterPattern: "", + CommitFilters: nil, + CommitSortBy: "", + CommitGroupBy: "", + CommitGroupSortBy: "", + CommitGroupTitleMaps: nil, + HeaderPattern: "", + HeaderPatternMaps: nil, + IssuePrefix: nil, + RefActions: nil, + MergePattern: "", + MergePatternMaps: nil, + RevertPattern: "", + RevertPatternMaps: nil, + NoteKeywords: nil, + JiraUsername: "uuu", + JiraToken: "ppp", + JiraUrl: "http://jira.com", + JiraTypeMaps: nil, + JiraIssueDescriptionPattern: "", + }, + } + + jira := NewJiraClient(config) + issue, err := jira.GetJiraIssue("fake") + assert.Nil(issue) + assert.Error(err) +} diff --git a/cmd/git-chglog/logger.go b/logger.go similarity index 98% rename from cmd/git-chglog/logger.go rename to logger.go index be64fc6e..52003ecb 100644 --- a/cmd/git-chglog/logger.go +++ b/logger.go @@ -1,4 +1,4 @@ -package main +package chglog import ( "fmt" diff --git a/cmd/git-chglog/logger_test.go b/logger_test.go similarity index 99% rename from cmd/git-chglog/logger_test.go rename to logger_test.go index 17bb8598..77f5ff4d 100644 --- a/cmd/git-chglog/logger_test.go +++ b/logger_test.go @@ -1,4 +1,4 @@ -package main +package chglog import ( "bytes" diff --git a/testdata/gitlog_jira.txt b/testdata/gitlog_jira.txt new file mode 100644 index 00000000..f535f2e1 --- /dev/null +++ b/testdata/gitlog_jira.txt @@ -0,0 +1 @@ +@@__CHGLOG__@@HASH:65cf1add9735dcc4810dda3312b0792236c97c4e 65cf1add@@__CHGLOG_DELIMITER__@@AUTHOR:tsuyoshi wada mail@example.com 1514808000@@__CHGLOG_DELIMITER__@@COMMITTER:tsuyoshi wada mail@example.com 1514808000@@__CHGLOG_DELIMITER__@@SUBJECT:[JIRA-1111]: Add new feature #123@@__CHGLOG_DELIMITER__@@BODY: This is body message. From 9d62af2943679b2e735504978c6bd72fe486c920 Mon Sep 17 00:00:00 2001 From: Mikael Fridh Date: Fri, 12 Mar 2021 13:57:00 +0100 Subject: [PATCH 08/82] feat(flag): --path filtering - refs (#62). Closes #35 * Argument: --path filtering - refs #35 * Minor documentation additions for Paths option --- README.md | 1 + chglog.go | 1 + cmd/git-chglog/config.go | 1 + cmd/git-chglog/context.go | 1 + cmd/git-chglog/main.go | 13 ++++++++++++- commit_parser.go | 16 ++++++++++++---- 6 files changed, 28 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8b5e1c76..6aaa33a4 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,7 @@ USAGE: OPTIONS: --init generate the git-chglog configuration file in interactive + --path value Filter commits by path(s). Can use multiple times. --config value, -c value specifies a different configuration file to pick up (default: ".chglog/config.yml") --output value, -o value output path and filename for the changelogs. If not specified, output to stdout --next-tag value treat unreleased commits as specified tags (EXPERIMENTAL) diff --git a/chglog.go b/chglog.go index 968b65cf..5a3427d3 100644 --- a/chglog.go +++ b/chglog.go @@ -40,6 +40,7 @@ type Options struct { JiraUrl string JiraTypeMaps map[string]string JiraIssueDescriptionPattern string + Paths []string // Path filter } // Info is metadata related to CHANGELOG diff --git a/cmd/git-chglog/config.go b/cmd/git-chglog/config.go index d2e4844d..2410b68c 100644 --- a/cmd/git-chglog/config.go +++ b/cmd/git-chglog/config.go @@ -292,6 +292,7 @@ func (config *Config) Convert(ctx *CLIContext) *chglog.Config { NextTag: ctx.NextTag, TagFilterPattern: ctx.TagFilterPattern, NoCaseSensitive: ctx.NoCaseSensitive, + Paths: ctx.Paths, CommitFilters: opts.Commits.Filters, CommitSortBy: opts.Commits.SortBy, CommitGroupBy: opts.CommitGroups.GroupBy, diff --git a/cmd/git-chglog/context.go b/cmd/git-chglog/context.go index 3f2e1aa8..a086cf15 100644 --- a/cmd/git-chglog/context.go +++ b/cmd/git-chglog/context.go @@ -23,6 +23,7 @@ type CLIContext struct { JiraUsername string JiraToken string JiraUrl string + Paths []string } // InitContext ... diff --git a/cmd/git-chglog/main.go b/cmd/git-chglog/main.go index 28005207..c8a61bd8 100644 --- a/cmd/git-chglog/main.go +++ b/cmd/git-chglog/main.go @@ -53,7 +53,11 @@ func CreateApp(actionFunc cli.ActionFunc) *cli.App { $ {{.Name}} --config custom/dir/config.yml - The above is a command that uses a configuration file placed other than ".chglog/config.yml". + The above is a command that uses a configuration file placed other than ".chglog/config.yml". + + $ {{.Name}} --path path/to/my/component --output CHANGELOG.component.md + + Filter commits by specific paths or files in git and output to a component specific changelog. `, ttl("USAGE:"), ttl("OPTIONS:"), @@ -76,6 +80,12 @@ func CreateApp(actionFunc cli.ActionFunc) *cli.App { Usage: "generate the git-chglog configuration file in interactive", }, + // path + &cli.StringSliceFlag{ + Name: "path", + Usage: "Filter commits by path(s). Can use multiple times.", + }, + // config &cli.StringFlag{ Name: "config, c", @@ -216,6 +226,7 @@ func AppAction(c *cli.Context) error { JiraUsername: c.String("jira-username"), JiraToken: c.String("jira-token"), JiraUrl: c.String("jira-url"), + Paths: c.StringSlice("path"), }, fs, NewConfigLoader(), diff --git a/commit_parser.go b/commit_parser.go index 83d38a45..f3cc7a8b 100644 --- a/commit_parser.go +++ b/commit_parser.go @@ -86,12 +86,20 @@ func newCommitParser(logger *Logger, client gitcmd.Client, jiraClient JiraClient } func (p *commitParser) Parse(rev string) ([]*Commit, error) { - out, err := p.client.Exec( - "log", + paths := p.config.Options.Paths + + args := []string{ rev, "--no-decorate", - "--pretty="+logFormat, - ) + "--pretty=" + logFormat, + } + + if len(paths) > 0 { + args = append(args, "--") + args = append(args, paths...) + } + + out, err := p.client.Exec("log", args...) if err != nil { return nil, err From 703cfdeffff441862decd823300804af2716cdbc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 12 Mar 2021 10:27:27 -0600 Subject: [PATCH 09/82] fix(deps): update all non-major dependencies (#115) Co-authored-by: Renovate Bot --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index daef7e59..82c6eabb 100644 --- a/go.mod +++ b/go.mod @@ -3,10 +3,10 @@ module github.com/git-chglog/git-chglog go 1.15 require ( - github.com/AlecAivazis/survey/v2 v2.2.8 + github.com/AlecAivazis/survey/v2 v2.2.9 github.com/andygrunwald/go-jira v1.13.0 github.com/fatih/color v1.10.0 - github.com/imdario/mergo v0.3.11 + github.com/imdario/mergo v0.3.12 github.com/kyokomi/emoji/v2 v2.2.8 github.com/mattn/go-colorable v0.1.8 github.com/stretchr/testify v1.7.0 diff --git a/go.sum b/go.sum index e141f10b..2e16e071 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/AlecAivazis/survey/v2 v2.2.8 h1:TgxCwybKdBckmC+/P9/5h49rw/nAHe/itZL0dgHs+Q0= -github.com/AlecAivazis/survey/v2 v2.2.8/go.mod h1:9DYvHgXtiXm6nCn+jXnOXLKbH+Yo9u8fAS/SduGdoPk= +github.com/AlecAivazis/survey/v2 v2.2.9 h1:LWvJtUswz/W9/zVVXELrmlvdwWcKE60ZAw0FWV9vssk= +github.com/AlecAivazis/survey/v2 v2.2.9/go.mod h1:9DYvHgXtiXm6nCn+jXnOXLKbH+Yo9u8fAS/SduGdoPk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8 h1:xzYJEypr/85nBpB11F9br+3HUrpgb+fcm5iADzXXYEw= github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc= @@ -22,8 +22,8 @@ github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 h1:zLTLjkaOF github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174 h1:WlZsjVhE8Af9IcZDGgJGQpNflI3+MJSBhsgT5PCtzBQ= github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A= -github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kr/pty v1.1.4 h1:5Myjjh3JY/NaAi4IsUbHADytDyl1VE1Y9PXDlL+P/VQ= From 0cc1984e29148be78bbf8aed5d27782400cb0735 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Fri, 12 Mar 2021 10:43:13 -0600 Subject: [PATCH 10/82] chore: bumps version to v0.11.0 --- cmd/git-chglog/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/git-chglog/version.go b/cmd/git-chglog/version.go index 64dec358..c604f82e 100644 --- a/cmd/git-chglog/version.go +++ b/cmd/git-chglog/version.go @@ -1,4 +1,4 @@ package main // Version of git-chglog cli client -const Version = "v0.10.0" +const Version = "v0.11.0" From b70aef4adb7160ff4f58562ed73ae07b6cc5a5b6 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Fri, 12 Mar 2021 10:56:26 -0600 Subject: [PATCH 11/82] chore: update changelog for v0.11.0 --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5195de0..c5577121 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html ## [Unreleased] + +## [v0.11.0] - 2021-03-12 +### Features +- add Jira integration ([#52](https://github.com/git-chglog/git-chglog/issues/52)) ## [v0.10.0] - 2021-01-16 @@ -167,7 +171,8 @@ https://github.com/git-chglog/git-chglog/releases/download/v/git-chglog - First implement -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.10.0...HEAD +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.11.0...HEAD +[v0.11.0]: https://github.com/git-chglog/git-chglog/compare/v0.10.0...v0.11.0 [v0.10.0]: https://github.com/git-chglog/git-chglog/compare/0.9.1...v0.10.0 [0.9.1]: https://github.com/git-chglog/git-chglog/compare/0.9.0...0.9.1 [0.9.0]: https://github.com/git-chglog/git-chglog/compare/0.8.0...0.9.0 From aa2732d6a271d910551f034ffc12583b245b575a Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Fri, 12 Mar 2021 14:56:24 -0600 Subject: [PATCH 12/82] fix(short flags): correctly define cli flags with shorthands (#117) --- cmd/git-chglog/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/git-chglog/main.go b/cmd/git-chglog/main.go index c8a61bd8..414f2186 100644 --- a/cmd/git-chglog/main.go +++ b/cmd/git-chglog/main.go @@ -89,13 +89,15 @@ func CreateApp(actionFunc cli.ActionFunc) *cli.App { // config &cli.StringFlag{ Name: "config, c", + Aliases: []string{"c"}, Usage: "specifies a different configuration file to pick up", Value: ".chglog/config.yml", }, // template &cli.StringFlag{ - Name: "template, t", + Name: "template", + Aliases: []string{"t"}, Usage: "specifies a template file to pick up. If not specified, use the one in config", }, @@ -107,7 +109,8 @@ func CreateApp(actionFunc cli.ActionFunc) *cli.App { // output &cli.StringFlag{ - Name: "output, o", + Name: "output", + Aliases: []string{"o"}, Usage: "output path and filename for the changelogs. If not specified, output to stdout", }, From e6e7a69a7d64536a09ebe7fb7cf75caf4e7c024f Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Fri, 12 Mar 2021 14:59:47 -0600 Subject: [PATCH 13/82] chore: bumps version to v0.11.1 --- cmd/git-chglog/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/git-chglog/version.go b/cmd/git-chglog/version.go index c604f82e..2638a12b 100644 --- a/cmd/git-chglog/version.go +++ b/cmd/git-chglog/version.go @@ -1,4 +1,4 @@ package main // Version of git-chglog cli client -const Version = "v0.11.0" +const Version = "v0.11.1" From 54bb7363dc209a065261450afa7f7c683b6f1d61 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Fri, 12 Mar 2021 15:12:16 -0600 Subject: [PATCH 14/82] chore: update readme and changelog for v0.11.1 --- CHANGELOG.md | 9 ++++++++- README.md | 33 +++++++++++++++++++++------------ 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5577121..753c421e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html ## [Unreleased] + +## [v0.11.1] - 2021-03-12 + +### Bug Fixes +- **short flags**: correctly define cli flags with shorthands ([#117](https://github.com/git-chglog/git-chglog/issues/117)) + ## [v0.11.0] - 2021-03-12 ### Features @@ -171,7 +177,8 @@ https://github.com/git-chglog/git-chglog/releases/download/v/git-chglog - First implement -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.11.0...HEAD +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.11.1...HEAD +[v0.11.1]: https://github.com/git-chglog/git-chglog/compare/v0.11.0...v0.11.1 [v0.11.0]: https://github.com/git-chglog/git-chglog/compare/v0.10.0...v0.11.0 [v0.10.0]: https://github.com/git-chglog/git-chglog/compare/0.9.1...v0.10.0 [0.9.1]: https://github.com/git-chglog/git-chglog/compare/0.9.0...0.9.1 diff --git a/README.md b/README.md index 6aaa33a4..d9ad9891 100644 --- a/README.md +++ b/README.md @@ -181,18 +181,23 @@ USAGE: 4. - Commit contained in . OPTIONS: - --init generate the git-chglog configuration file in interactive - --path value Filter commits by path(s). Can use multiple times. - --config value, -c value specifies a different configuration file to pick up (default: ".chglog/config.yml") - --output value, -o value output path and filename for the changelogs. If not specified, output to stdout - --next-tag value treat unreleased commits as specified tags (EXPERIMENTAL) - --silent disable stdout output - --no-color disable color output [$NO_COLOR] - --no-emoji disable emoji output [$NO_EMOJI] - --no-case disable case sensitive filters - --tag-filter-pattern value, -p value regular expression of tag filter. Is specified, only matched tags will be picked - --help, -h show help - --version, -v print the version + --init generate the git-chglog configuration file in interactive (default: false) + --path value Filter commits by path(s). Can use multiple times. + --config value, -c value specifies a different configuration file to pick up (default: ".chglog/config.yml") + --template value, -t value specifies a template file to pick up. If not specified, use the one in config + --repository-url value specifies git repo URL. If not specified, use 'repository_url' in config + --output value, -o value output path and filename for the changelogs. If not specified, output to stdout + --next-tag value treat unreleased commits as specified tags (EXPERIMENTAL) + --silent disable stdout output (default: false) + --no-color disable color output (default: false) [$NO_COLOR] + --no-emoji disable emoji output (default: false) [$NO_EMOJI] + --no-case disable case sensitive filters (default: false) + --tag-filter-pattern value Regular expression of tag filter. Is specified, only matched tags will be picked + --jira-url value Jira URL [$JIRA_URL] + --jira-username value Jira username [$JIRA_USERNAME] + --jira-token value Jira token [$JIRA_TOKEN] + --help, -h show help (default: false) + --version, -v print the version (default: false) EXAMPLE: @@ -220,6 +225,10 @@ EXAMPLE: $ git-chglog --config custom/dir/config.yml The above is a command that uses a configuration file placed other than ".chglog/config.yml". + + $ git-chglog --path path/to/my/component --output CHANGELOG.component.md + + Filter commits by specific paths or files in git and output to a component specific changelog. ``` ### `tag query` From a7ea3972688b1f1739c8484b64049de42211038d Mon Sep 17 00:00:00 2001 From: Prasad Tengse <10941447+tprasadtp@users.noreply.github.com> Date: Sun, 14 Mar 2021 04:54:40 +0100 Subject: [PATCH 15/82] fix: `--template` and `--repository-url` flags not being used (#119) Co-authored-by: Prasad Tengse --- cmd/git-chglog/main.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cmd/git-chglog/main.go b/cmd/git-chglog/main.go index 414f2186..e3f862f6 100644 --- a/cmd/git-chglog/main.go +++ b/cmd/git-chglog/main.go @@ -88,17 +88,17 @@ func CreateApp(actionFunc cli.ActionFunc) *cli.App { // config &cli.StringFlag{ - Name: "config, c", + Name: "config, c", Aliases: []string{"c"}, - Usage: "specifies a different configuration file to pick up", - Value: ".chglog/config.yml", + Usage: "specifies a different configuration file to pick up", + Value: ".chglog/config.yml", }, // template &cli.StringFlag{ - Name: "template", + Name: "template", Aliases: []string{"t"}, - Usage: "specifies a template file to pick up. If not specified, use the one in config", + Usage: "specifies a template file to pick up. If not specified, use the one in config", }, // repository url @@ -109,9 +109,9 @@ func CreateApp(actionFunc cli.ActionFunc) *cli.App { // output &cli.StringFlag{ - Name: "output", + Name: "output", Aliases: []string{"o"}, - Usage: "output path and filename for the changelogs. If not specified, output to stdout", + Usage: "output path and filename for the changelogs. If not specified, output to stdout", }, &cli.StringFlag{ @@ -218,6 +218,8 @@ func AppAction(c *cli.Context) error { Stdout: colorable.NewColorableStdout(), Stderr: colorable.NewColorableStderr(), ConfigPath: c.String("config"), + Template: c.String("template"), + RepositoryUrl: c.String("repository-url"), OutputPath: c.String("output"), Silent: c.Bool("silent"), NoColor: c.Bool("no-color"), From 500a5db7e914c0919a71521ab6d1cabcfdcf8313 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Sat, 13 Mar 2021 21:56:04 -0600 Subject: [PATCH 16/82] chore: bumps version to v0.11.2 --- cmd/git-chglog/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/git-chglog/version.go b/cmd/git-chglog/version.go index 2638a12b..11f8414f 100644 --- a/cmd/git-chglog/version.go +++ b/cmd/git-chglog/version.go @@ -1,4 +1,4 @@ package main // Version of git-chglog cli client -const Version = "v0.11.1" +const Version = "v0.11.2" From c3ee5604292e474ee969031f853bcac4e284076c Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Sat, 13 Mar 2021 21:57:11 -0600 Subject: [PATCH 17/82] chore: update changelog for v0.11.2 --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 753c421e..91038d7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html ## [Unreleased] + +## [v0.11.2] - 2021-03-13 +### Bug Fixes +- `--template` and `--repository-url` flags not being used ([#119](https://github.com/git-chglog/git-chglog/issues/119)) + ## [v0.11.1] - 2021-03-12 @@ -177,7 +182,8 @@ https://github.com/git-chglog/git-chglog/releases/download/v/git-chglog - First implement -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.11.1...HEAD +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.11.2...HEAD +[v0.11.2]: https://github.com/git-chglog/git-chglog/compare/v0.11.1...v0.11.2 [v0.11.1]: https://github.com/git-chglog/git-chglog/compare/v0.11.0...v0.11.1 [v0.11.0]: https://github.com/git-chglog/git-chglog/compare/v0.10.0...v0.11.0 [v0.10.0]: https://github.com/git-chglog/git-chglog/compare/0.9.1...v0.10.0 From 2c3d3f400efe063e85028f84c5c2df8c2d0a3e14 Mon Sep 17 00:00:00 2001 From: Manuel Vogel Date: Sun, 14 Mar 2021 21:21:30 +0100 Subject: [PATCH 18/82] chore: bump golang to 1.16 (#118) * chore: support goarch 386 * docs(readme): add golang version hint in development section --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- .goreleaser.yml | 3 +-- README.md | 4 ++++ go.mod | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b147159b..2cc15f77 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.15 + go-version: 1.16 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3139b5da..b7f9c396 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.15 + go-version: 1.16 - name: Run tests run: | make test diff --git a/.goreleaser.yml b/.goreleaser.yml index 2d01566a..0272d395 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -16,11 +16,10 @@ builds: - windows - darwin goarch: + - 386 - amd64 - arm - arm64 - goarm: - - 6 archives: - format_overrides: diff --git a/README.md b/README.md index d9ad9891..231b038b 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,9 @@ - [Templates](#templates) - [Supported Styles](#supported-styles) - [Jira Integration](#jira-integration) + - [1. Change the header parse pattern to recognize Jira issue id in the configure file.](#1-change-the-header-parse-pattern-to-recognize-jira-issue-id-in-the-configure-file) + - [2. Add Jira configuration to the configure file.](#2-add-jira-configuration-to-the-configure-file) + - [3. Update the template to show Jira data.](#3-update-the-template-to-show-jira-data) - [FAQ](#faq) - [TODO](#todo) - [Thanks](#thanks) @@ -639,6 +642,7 @@ We alway welcome your contributions :clap: ### Development +1. Use Golang version `>= 1.16` 1. Fork (https://github.com/git-chglog/git-chglog) :tada: 1. Create a feature branch :coffee: 1. Run test suite with the `$ make test` command and confirm that it passes :zap: diff --git a/go.mod b/go.mod index 82c6eabb..b9a8a7e3 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/git-chglog/git-chglog -go 1.15 +go 1.16 require ( github.com/AlecAivazis/survey/v2 v2.2.9 From ae3382b7c8175be9fec858e93058c10d89b1d8ad Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Tue, 16 Mar 2021 21:24:36 -0500 Subject: [PATCH 19/82] chore(ci): add golangci-lint action and apply linting changes (#120) BREAKING CHANGE: `JiraIssueId` has been renamed to `JiraIssueID`. This impacts the value for `pattern_maps` in `config.yml`. * chore(ci): add golangci-lint action * chore(lint): address errcheck lint failures * chore(lint): address misspell lint failures * chore(lint): address gocritic lint failures * chore(lint): address golint lint failures * chore(lint): address structcheck lint failures * chore(lint): address gosimple lint failures * chore(lint): address gofmt lint failures * chore(ci): port to official golangci-lint github action * Update golangci configuration for better coverage Signed-off-by: Khosrow Moossavi * fix: file is not goimports-ed Signed-off-by: Khosrow Moossavi * fix: golint and exported functions comments Signed-off-by: Khosrow Moossavi * chore(lint): address gosec G304 warning * chore(lint): address uparam warnings * chore(lint): address scopelint lint failures * fix: cyclomatic complexity Signed-off-by: Khosrow Moossavi * chore(lint): address prealloc warning, noting that we are warning for now * chore(lint): address govet and errorlint failures * chore: clean up defer logic when checking errors Co-authored-by: Khosrow Moossavi --- .github/workflows/lint.yml | 18 +++ .golangci.yml | 155 ++++++++++++++++++++++ Makefile | 4 + README.md | 4 +- chglog.go | 39 +++--- chglog_test.go | 38 +++--- cmd/git-chglog/cli.go | 1 + cmd/git-chglog/cli_test.go | 7 +- cmd/git-chglog/config.go | 8 +- cmd/git-chglog/config_loader.go | 6 +- cmd/git-chglog/context.go | 4 +- cmd/git-chglog/custom_template_builder.go | 4 +- cmd/git-chglog/initializer.go | 5 +- cmd/git-chglog/main.go | 16 ++- cmd/git-chglog/main_test.go | 13 +- cmd/git-chglog/processor_factory_test.go | 3 +- cmd/git-chglog/questioner.go | 11 +- cmd/git-chglog/utils.go | 2 +- cmd/git-chglog/variables.go | 2 +- commit_extractor.go | 15 ++- commit_extractor_test.go | 24 ++-- commit_filter.go | 6 +- commit_filter_test.go | 10 +- commit_parser.go | 12 +- commit_parser_test.go | 34 ++--- example_test.go | 2 +- fields.go | 14 +- jira.go | 6 +- jira_test.go | 7 +- logger.go | 4 +- logger_test.go | 4 +- processor.go | 12 +- processor_test.go | 12 +- tag_reader.go | 3 +- tag_reader_test.go | 18 +-- tag_selector.go | 13 +- tag_selector_test.go | 32 ++--- 37 files changed, 391 insertions(+), 177 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 .golangci.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..49f5fde0 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,18 @@ +name: lint + +on: + pull_request: + types: ['opened', 'synchronize'] + push: + branches: + - master +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + version: v1.38 diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..c409770d --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,155 @@ +# https://golangci-lint.run/usage/configuration/ +run: + timeout: 10m + deadline: 5m + + tests: true + +output: + format: tab + +linters-settings: + govet: + # report about shadowed variables + check-shadowing: true + + golint: + # minimal confidence for issues, default is 0.8 + min-confidence: 0.8 + + gofmt: + # simplify code: gofmt with `-s` option, true by default + simplify: true + + goimports: + # put imports beginning with prefix after 3rd-party packages; + # it's a comma-separated list of prefixes + local-prefixes: github.com/git-chglog/git-chglog + + gocyclo: + # minimal code complexity to report, 30 by default (but we recommend 10-20) + min-complexity: 10 + + maligned: + # print struct with more effective memory layout or not, false by default + suggest-new: true + + dupl: + # tokens count to trigger issue, 150 by default + threshold: 100 + + goconst: + # minimal length of string constant, 3 by default + min-len: 3 + # minimal occurrences count to trigger, 3 by default + min-occurrences: 5 + + lll: + # tab width in spaces. Default to 1. + tab-width: 1 + + unused: + # treat code as a program (not a library) and report unused exported identifiers; default is false. + # XXX: if you enable this setting, unused will report a lot of false-positives in text editors: + # if it's called for subdir of a project it can't find funcs usages. All text editor integrations + # with golangci-lint call it on a directory with the changed file. + check-exported: false + + unparam: + # Inspect exported functions, default is false. Set to true if no external program/library imports your code. + # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: + # if it's called for subdir of a project it can't find external interfaces. All text editor integrations + # with golangci-lint call it on a directory with the changed file. + check-exported: false + + nakedret: + # make an issue if func has more lines of code than this setting and it has naked returns; default is 30 + max-func-lines: 30 + + prealloc: + # XXX: we don't recommend using this linter before doing performance profiling. + # For most programs usage of prealloc will be a premature optimization. + + # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them. + # True by default. + simple: true + range-loops: true # Report preallocation suggestions on range loops, true by default + for-loops: false # Report preallocation suggestions on for loops, false by default + + gocritic: + # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks. + # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags". + enabled-tags: + - performance + + settings: # settings passed to gocritic + captLocal: # must be valid enabled check name + paramsOnly: true + rangeValCopy: + sizeThreshold: 32 + + misspell: + locale: US + +linters: + enable: + - megacheck + - govet + - gocyclo + - gocritic + - interfacer + - goconst + - goimports + - gofmt # We enable this as well as goimports for its simplify mode. + - prealloc + - golint + - unconvert + - misspell + - nakedret + - dupl + - depguard + + presets: + - bugs + - unused + fast: false + +issues: + # Excluding configuration per-path and per-linter + exclude-rules: + # Exclude some linters from running on tests files. + - path: _test(ing)?\.go + linters: + - gocyclo + - errcheck + - dupl + - gosec + - scopelint + - unparam + + # These are performance optimisations rather than style issues per se. + # They warn when function arguments or range values copy a lot of memory + # rather than using a pointer. + - text: "(hugeParam|rangeValCopy):" + linters: + - gocritic + + # Independently from option `exclude` we use default exclude patterns, + # it can be disabled by this option. To list all + # excluded by default patterns execute `golangci-lint run --help`. + # Default value for this option is true. + exclude-use-default: false + + # Show only new issues: if there are unstaged changes or untracked files, + # only those changes are analyzed, else only changes in HEAD~ are analyzed. + # It's a super-useful option for integration of golangci-lint into existing + # large codebase. It's not practical to fix all existing issues at the moment + # of integration: much better don't allow issues in new code. + # Default is false. + new: false + + # Maximum issues count per one linter. Set to 0 to disable. Default is 50. + max-per-linter: 0 + + # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. + max-same-issues: 0 diff --git a/Makefile b/Makefile index 1f27d92a..fa11f871 100644 --- a/Makefile +++ b/Makefile @@ -20,3 +20,7 @@ install: .PHONY: changelog changelog: @git-chglog --next-tag $(tag) $(tag) + +.PHONY: lint +lint: + @golangci-lint run diff --git a/README.md b/README.md index 231b038b..9e4fbf00 100644 --- a/README.md +++ b/README.md @@ -522,7 +522,7 @@ The following is a sample pattern: pattern: "^(?:(\\w*)|(?:\\[(.*)\\])?)\\:\\s(.*)$" pattern_maps: - Type - - JiraIssueId + - JiraIssueID - Subject ``` @@ -646,6 +646,8 @@ We alway welcome your contributions :clap: 1. Fork (https://github.com/git-chglog/git-chglog) :tada: 1. Create a feature branch :coffee: 1. Run test suite with the `$ make test` command and confirm that it passes :zap: +1. Run linters with the `$ make lint` command and confirm it passes :broom: + - The project uses [golangci-lint](https://golangci-lint.run/usage/install/#local-installation) 1. Commit your changes :memo: 1. Rebase your local changes against the `master` branch :bulb: 1. Create new Pull Request :love_letter: diff --git a/chglog.go b/chglog.go index 5a3427d3..f71f8095 100644 --- a/chglog.go +++ b/chglog.go @@ -5,13 +5,14 @@ import ( "errors" "fmt" "io" + "log" "os" "path/filepath" "strings" "text/template" "time" - gitcmd "github.com/tsuyoshiwada/go-gitcmd" + "github.com/tsuyoshiwada/go-gitcmd" ) // Options is an option used to process commits @@ -37,7 +38,7 @@ type Options struct { NoteKeywords []string // Keyword list to find `Note`. A semicolon is a separator, like `:` (e.g. `BREAKING CHANGE`) JiraUsername string JiraToken string - JiraUrl string + JiraURL string JiraTypeMaps map[string]string JiraIssueDescriptionPattern string Paths []string // Path filter @@ -138,7 +139,11 @@ func (gen *Generator) Generate(w io.Writer, query string) error { if err != nil { return err } - defer back() + defer func() { + if err = back(); err != nil { + log.Fatal(err) + } + }() tags, first, err := gen.getTags(query) if err != nil { @@ -269,7 +274,7 @@ func (gen *Generator) getTags(query string) ([]*Tag, string, error) { // Assign the date with `readVersions()` tags = append([]*Tag{ - &Tag{ + { Name: next, Subject: next, Previous: previous, @@ -318,30 +323,18 @@ func (gen *Generator) render(w io.Writer, unreleased *Unreleased, versions []*Ve "datetime": func(layout string, input time.Time) string { return input.Format(layout) }, - // check whether substs is withing s - "contains": func(s, substr string) bool { - return strings.Contains(s, substr) - }, + // check whether substr is within s + "contains": strings.Contains, // check whether s begins with prefix - "hasPrefix": func(s, prefix string) bool { - return strings.HasPrefix(s, prefix) - }, + "hasPrefix": strings.HasPrefix, // check whether s ends with suffix - "hasSuffix": func(s, suffix string) bool { - return strings.HasSuffix(s, suffix) - }, + "hasSuffix": strings.HasSuffix, // replace the first n instances of old with new - "replace": func(s, old, new string, n int) string { - return strings.Replace(s, old, new, n) - }, + "replace": strings.Replace, // lower case a string - "lower": func(s string) string { - return strings.ToLower(s) - }, + "lower": strings.ToLower, // upper case a string - "upper": func(s string) string { - return strings.ToUpper(s) - }, + "upper": strings.ToUpper, // upper case the first character of a string "upperFirst": func(s string) string { if len(s) > 0 { diff --git a/chglog_test.go b/chglog_test.go index 8e2a3e9e..47082a36 100644 --- a/chglog_test.go +++ b/chglog_test.go @@ -32,17 +32,17 @@ func TestMain(m *testing.M) { func setup(dir string, setupRepo func(commitFunc, tagFunc, gitcmd.Client)) { testDir := filepath.Join(cwd, testRepoRoot, dir) - os.RemoveAll(testDir) - os.MkdirAll(testDir, os.ModePerm) - os.Chdir(testDir) + _ = os.RemoveAll(testDir) + _ = os.MkdirAll(testDir, os.ModePerm) + _ = os.Chdir(testDir) loc, _ := time.LoadLocation("UTC") time.Local = loc git := gitcmd.New(nil) - git.Exec("init") - git.Exec("config", "user.name", "test_user") - git.Exec("config", "user.email", "test@example.com") + _, _ = git.Exec("init") + _, _ = git.Exec("config", "user.name", "test_user") + _, _ = git.Exec("config", "user.email", "test@example.com") var commit = func(date, subject, body string) { msg := subject @@ -51,21 +51,21 @@ func setup(dir string, setupRepo func(commitFunc, tagFunc, gitcmd.Client)) { } t, _ := time.Parse(internalTimeFormat, date) d := t.Format("Mon Jan 2 15:04:05 2006 +0000") - git.Exec("commit", "--allow-empty", "--date", d, "-m", msg) + _, _ = git.Exec("commit", "--allow-empty", "--date", d, "-m", msg) } var tag = func(name string) { - git.Exec("tag", name) + _, _ = git.Exec("tag", name) } setupRepo(commit, tag, git) - os.Chdir(cwd) + _ = os.Chdir(cwd) } func cleanup() { - os.Chdir(cwd) - os.RemoveAll(filepath.Join(cwd, testRepoRoot)) + _ = os.Chdir(cwd) + _ = os.RemoveAll(filepath.Join(cwd, testRepoRoot)) } func TestGeneratorNotFoundTags(t *testing.T) { @@ -193,7 +193,7 @@ func TestGeneratorWithTypeScopeSubject(t *testing.T) { tag("1.1.0") commit("2018-01-03 00:00:00", "feat(context): Online breaking change", "BREAKING CHANGE: Online breaking change message.") - commit("2018-01-03 00:01:00", "feat(router): Muliple breaking change", `This is body, + commit("2018-01-03 00:01:00", "feat(router): Multiple breaking change", `This is body, BREAKING CHANGE: Multiple @@ -216,7 +216,7 @@ change message.`) }, Options: &Options{ CommitFilters: map[string][]string{ - "Type": []string{ + "Type": { "feat", "fix", }, @@ -256,7 +256,7 @@ change message.`) buf := &bytes.Buffer{} err := gen.Generate(buf, "") - output := strings.Replace(strings.TrimSpace(buf.String()), "\r\n", "\n", -1) + output := strings.ReplaceAll(strings.TrimSpace(buf.String()), "\r\n", "\n") assert.Nil(err) assert.Equal(` @@ -270,7 +270,7 @@ change message.`) ## [2.0.0-beta.0] - 2018-01-03 ### Features - **context:** Online breaking change -- **router:** Muliple breaking change +- **router:** Multiple breaking change ### BREAKING CHANGE @@ -331,7 +331,7 @@ func TestGeneratorWithNextTag(t *testing.T) { Options: &Options{ NextTag: "3.0.0", CommitFilters: map[string][]string{ - "Type": []string{ + "Type": { "feat", }, }, @@ -352,7 +352,7 @@ func TestGeneratorWithNextTag(t *testing.T) { buf := &bytes.Buffer{} err := gen.Generate(buf, "") - output := strings.Replace(strings.TrimSpace(buf.String()), "\r\n", "\n", -1) + output := strings.ReplaceAll(strings.TrimSpace(buf.String()), "\r\n", "\n") assert.Nil(err) assert.Equal(` @@ -383,7 +383,7 @@ func TestGeneratorWithNextTag(t *testing.T) { buf = &bytes.Buffer{} err = gen.Generate(buf, "3.0.0") - output = strings.Replace(strings.TrimSpace(buf.String()), "\r\n", "\n", -1) + output = strings.ReplaceAll(strings.TrimSpace(buf.String()), "\r\n", "\n") assert.Nil(err) assert.Equal(` @@ -424,7 +424,7 @@ func TestGeneratorWithTagFiler(t *testing.T) { Options: &Options{ TagFilterPattern: "^v", CommitFilters: map[string][]string{ - "Type": []string{ + "Type": { "feat", }, }, diff --git a/cmd/git-chglog/cli.go b/cmd/git-chglog/cli.go index 2f2b4c1b..4c5cd813 100644 --- a/cmd/git-chglog/cli.go +++ b/cmd/git-chglog/cli.go @@ -7,6 +7,7 @@ import ( "time" "github.com/fatih/color" + chglog "github.com/git-chglog/git-chglog" ) diff --git a/cmd/git-chglog/cli_test.go b/cmd/git-chglog/cli_test.go index ba70c172..e1b4e079 100644 --- a/cmd/git-chglog/cli_test.go +++ b/cmd/git-chglog/cli_test.go @@ -8,8 +8,9 @@ import ( "regexp" "testing" - chglog "github.com/git-chglog/git-chglog" "github.com/stretchr/testify/assert" + + chglog "github.com/git-chglog/git-chglog" ) func TestCLIForStdout(t *testing.T) { @@ -36,7 +37,7 @@ func TestCLIForStdout(t *testing.T) { if config.Bin != "/custom/bin/git" { return errors.New("") } - w.Write([]byte("success!!")) + _, _ = w.Write([]byte("success!!")) return nil }, } @@ -104,7 +105,7 @@ func TestCLIForFile(t *testing.T) { if filepath.ToSlash(config.Bin) != "/custom/bin/git" { return errors.New("") } - w.Write([]byte("success!!")) + _, _ = w.Write([]byte("success!!")) return nil }, } diff --git a/cmd/git-chglog/config.go b/cmd/git-chglog/config.go index 2410b68c..b3992b86 100644 --- a/cmd/git-chglog/config.go +++ b/cmd/git-chglog/config.go @@ -4,8 +4,9 @@ import ( "path/filepath" "strings" - chglog "github.com/git-chglog/git-chglog" "github.com/imdario/mergo" + + chglog "github.com/git-chglog/git-chglog" ) // Info ... @@ -49,6 +50,7 @@ type NoteOptions struct { Keywords []string `yaml:"keywords"` } +// JiraClientInfoOptions ... type JiraClientInfoOptions struct { Username string `yaml:"username"` Token string `yaml:"token"` @@ -286,7 +288,7 @@ func (config *Config) Convert(ctx *CLIContext) *chglog.Config { Template: orValue(ctx.Template, config.Template), Info: &chglog.Info{ Title: info.Title, - RepositoryURL: orValue(ctx.RepositoryUrl, info.RepositoryURL), + RepositoryURL: orValue(ctx.RepositoryURL, info.RepositoryURL), }, Options: &chglog.Options{ NextTag: ctx.NextTag, @@ -309,7 +311,7 @@ func (config *Config) Convert(ctx *CLIContext) *chglog.Config { NoteKeywords: opts.Notes.Keywords, JiraUsername: orValue(ctx.JiraUsername, opts.Jira.ClintInfo.Username), JiraToken: orValue(ctx.JiraToken, opts.Jira.ClintInfo.Token), - JiraUrl: orValue(ctx.JiraUrl, opts.Jira.ClintInfo.URL), + JiraURL: orValue(ctx.JiraURL, opts.Jira.ClintInfo.URL), JiraTypeMaps: opts.Jira.Issue.TypeMaps, JiraIssueDescriptionPattern: opts.Jira.Issue.DescriptionPattern, }, diff --git a/cmd/git-chglog/config_loader.go b/cmd/git-chglog/config_loader.go index c20d2950..d49eb779 100644 --- a/cmd/git-chglog/config_loader.go +++ b/cmd/git-chglog/config_loader.go @@ -2,8 +2,9 @@ package main import ( "io/ioutil" + "path/filepath" - yaml "gopkg.in/yaml.v2" + "gopkg.in/yaml.v2" ) // ConfigLoader ... @@ -20,7 +21,8 @@ func NewConfigLoader() ConfigLoader { } func (loader *configLoaderImpl) Load(path string) (*Config, error) { - bytes, err := ioutil.ReadFile(path) + fp := filepath.Clean(path) + bytes, err := ioutil.ReadFile(fp) if err != nil { return nil, err } diff --git a/cmd/git-chglog/context.go b/cmd/git-chglog/context.go index a086cf15..65dea9db 100644 --- a/cmd/git-chglog/context.go +++ b/cmd/git-chglog/context.go @@ -11,7 +11,7 @@ type CLIContext struct { Stderr io.Writer ConfigPath string Template string - RepositoryUrl string + RepositoryURL string OutputPath string Silent bool NoColor bool @@ -22,7 +22,7 @@ type CLIContext struct { TagFilterPattern string JiraUsername string JiraToken string - JiraUrl string + JiraURL string Paths []string } diff --git a/cmd/git-chglog/custom_template_builder.go b/cmd/git-chglog/custom_template_builder.go index b41ec392..84606c82 100644 --- a/cmd/git-chglog/custom_template_builder.go +++ b/cmd/git-chglog/custom_template_builder.go @@ -18,7 +18,7 @@ func (t *customTemplateBuilderImpl) Build(ans *Answer) (string, error) { tpl += t.versionHeader(ans.Style, ans.Template) // commits - tpl += t.commits(ans.Template, ans.CommitMessageFormat) + tpl += t.commits(ans.CommitMessageFormat) // revert if ans.IncludeReverts { @@ -75,7 +75,7 @@ func (*customTemplateBuilderImpl) versionHeader(style, template string) string { return tpl } -func (*customTemplateBuilderImpl) commits(template, format string) string { +func (*customTemplateBuilderImpl) commits(format string) string { var ( header string body string diff --git a/cmd/git-chglog/initializer.go b/cmd/git-chglog/initializer.go index c0a8489a..7b404b74 100644 --- a/cmd/git-chglog/initializer.go +++ b/cmd/git-chglog/initializer.go @@ -2,17 +2,16 @@ package main import ( "fmt" - "github.com/git-chglog/git-chglog" "path/filepath" "github.com/fatih/color" - gitcmd "github.com/tsuyoshiwada/go-gitcmd" + + chglog "github.com/git-chglog/git-chglog" ) // Initializer ... type Initializer struct { ctx *InitContext - client gitcmd.Client fs FileSystem logger *chglog.Logger questioner Questioner diff --git a/cmd/git-chglog/main.go b/cmd/git-chglog/main.go index e3f862f6..562a0a78 100644 --- a/cmd/git-chglog/main.go +++ b/cmd/git-chglog/main.go @@ -3,14 +3,17 @@ package main import ( "fmt" "io" + "log" "os" "github.com/fatih/color" "github.com/mattn/go-colorable" - gitcmd "github.com/tsuyoshiwada/go-gitcmd" + "github.com/tsuyoshiwada/go-gitcmd" "github.com/urfave/cli/v2" ) +// CreateApp creates and initializes CLI application +// with description, flags, version, etc. func CreateApp(actionFunc cli.ActionFunc) *cli.App { ttl := color.New(color.FgYellow).SprintFunc() @@ -182,6 +185,8 @@ func CreateApp(actionFunc cli.ActionFunc) *cli.App { return app } +// AppAction is a callback function to create initializer +// and CLIContext and ultimately run the application. func AppAction(c *cli.Context) error { wd, err := os.Getwd() if err != nil { @@ -219,7 +224,7 @@ func AppAction(c *cli.Context) error { Stderr: colorable.NewColorableStderr(), ConfigPath: c.String("config"), Template: c.String("template"), - RepositoryUrl: c.String("repository-url"), + RepositoryURL: c.String("repository-url"), OutputPath: c.String("output"), Silent: c.Bool("silent"), NoColor: c.Bool("no-color"), @@ -230,7 +235,7 @@ func AppAction(c *cli.Context) error { TagFilterPattern: c.String("tag-filter-pattern"), JiraUsername: c.String("jira-username"), JiraToken: c.String("jira-token"), - JiraUrl: c.String("jira-url"), + JiraURL: c.String("jira-url"), Paths: c.StringSlice("path"), }, fs, @@ -245,5 +250,8 @@ func AppAction(c *cli.Context) error { func main() { app := CreateApp(AppAction) - app.Run(os.Args) + err := app.Run(os.Args) + if err != nil { + log.Fatal(err) + } } diff --git a/cmd/git-chglog/main_test.go b/cmd/git-chglog/main_test.go index b7f4e396..46f762c3 100644 --- a/cmd/git-chglog/main_test.go +++ b/cmd/git-chglog/main_test.go @@ -1,14 +1,16 @@ package main import ( + "log" + "testing" + "github.com/stretchr/testify/assert" "github.com/urfave/cli/v2" - "testing" ) var gAssert *assert.Assertions -func mock_app_action(c *cli.Context) error { +func mockAppAction(c *cli.Context) error { assert := gAssert assert.Equal("c.yml", c.String("config")) assert.Equal("^v", c.String("tag-filter-pattern")) @@ -25,7 +27,7 @@ func TestCreateApp(t *testing.T) { assert.True(true) gAssert = assert - app := CreateApp(mock_app_action) + app := CreateApp(mockAppAction) args := []string{ "git-chglog", "--silent", @@ -36,5 +38,8 @@ func TestCreateApp(t *testing.T) { "--next-tag", "v5", "--tag-filter-pattern", "^v", } - app.Run(args) + err := app.Run(args) + if err != nil { + log.Fatal(err) + } } diff --git a/cmd/git-chglog/processor_factory_test.go b/cmd/git-chglog/processor_factory_test.go index f9d5c5bc..b9fca58f 100644 --- a/cmd/git-chglog/processor_factory_test.go +++ b/cmd/git-chglog/processor_factory_test.go @@ -3,8 +3,9 @@ package main import ( "testing" - chglog "github.com/git-chglog/git-chglog" "github.com/stretchr/testify/assert" + + chglog "github.com/git-chglog/git-chglog" ) func TestProcessorFactory(t *testing.T) { diff --git a/cmd/git-chglog/questioner.go b/cmd/git-chglog/questioner.go index 99ba5b23..5b801487 100644 --- a/cmd/git-chglog/questioner.go +++ b/cmd/git-chglog/questioner.go @@ -6,8 +6,8 @@ import ( "path/filepath" "strings" - gitcmd "github.com/tsuyoshiwada/go-gitcmd" - survey "github.com/AlecAivazis/survey/v2" + "github.com/AlecAivazis/survey/v2" + "github.com/tsuyoshiwada/go-gitcmd" ) // Answer ... @@ -52,11 +52,12 @@ func (q *questionerImpl) Ask() (*Answer, error) { t := q.fs.Exists(tpl) msg := "" - if c && t { + switch { + case c && t: msg = fmt.Sprintf("\"%s\" and \"%s\" already exists. Do you want to overwrite?", config, tpl) - } else if c { + case c: msg = fmt.Sprintf("\"%s\" already exists. Do you want to overwrite?", config) - } else if t { + case t: msg = fmt.Sprintf("\"%s\" already exists. Do you want to overwrite?", tpl) } diff --git a/cmd/git-chglog/utils.go b/cmd/git-chglog/utils.go index 7ff14b0a..1d961499 100644 --- a/cmd/git-chglog/utils.go +++ b/cmd/git-chglog/utils.go @@ -7,7 +7,7 @@ import ( "strings" ) -var reSSH = regexp.MustCompile("^\\w+@([\\w\\.\\-]+):([\\w\\.\\-]+)\\/([\\w\\.\\-]+)$") +var reSSH = regexp.MustCompile(`^\w+@([\w\.\-]+):([\w\.\-]+)\/([\w\.\-]+)$`) func remoteOriginURLToHTTP(rawurl string) string { if rawurl == "" { diff --git a/cmd/git-chglog/variables.go b/cmd/git-chglog/variables.go index 60a7cbc9..59eeeb84 100644 --- a/cmd/git-chglog/variables.go +++ b/cmd/git-chglog/variables.go @@ -74,7 +74,7 @@ func (f *CommitMessageFormat) PatternMapString() string { return fmt.Sprintf("\n%s", strings.Join(arr, "\n")) } -// FilterTypeString ... +// FilterTypesString ... func (f *CommitMessageFormat) FilterTypesString() string { if len(f.typeSamples) == 0 { return " []" diff --git a/commit_extractor.go b/commit_extractor.go index ea1b2996..c5921ca7 100644 --- a/commit_extractor.go +++ b/commit_extractor.go @@ -127,7 +127,11 @@ func (e *commitExtractor) commitGroupTitle(commit *Commit) (string, string) { return raw, ttl } -func (e *commitExtractor) sortCommitGroups(groups []*CommitGroup) { +func (e *commitExtractor) sortCommitGroups(groups []*CommitGroup) { //nolint:gocyclo + // NOTE(khos2ow): this function is over our cyclomatic complexity goal. + // Be wary when adding branches, and look for functionality that could + // be reasonably moved into an injected dependency. + order := make(map[string]int) if e.opts.CommitGroupSortBy == "Custom" { for i, t := range e.opts.CommitGroupTitleOrder { @@ -136,6 +140,9 @@ func (e *commitExtractor) sortCommitGroups(groups []*CommitGroup) { } // groups + // TODO(khos2ow): move the inline sort function to + // conceret implementation of sort.Interface in order + // to reduce cyclomatic complaxity. sort.Slice(groups, func(i, j int) bool { if e.opts.CommitGroupSortBy == "Custom" { return order[groups[i].RawTitle] < order[groups[j].RawTitle] @@ -165,6 +172,11 @@ func (e *commitExtractor) sortCommitGroups(groups []*CommitGroup) { // commits for _, group := range groups { + group := group // pin group to avoid potential bugs with passing group to lower functions + + // TODO(khos2ow): move the inline sort function to + // conceret implementation of sort.Interface in order + // to reduce cyclomatic complaxity. sort.Slice(group.Commits, func(i, j int) bool { var ( a, b interface{} @@ -198,6 +210,7 @@ func (e *commitExtractor) sortNoteGroups(groups []*NoteGroup) { // notes for _, group := range groups { + group := group // pin group to avoid potential bugs with passing group to lower functions sort.Slice(group.Notes, func(i, j int) bool { return strings.ToLower(group.Notes[i].Title) < strings.ToLower(group.Notes[j].Title) }) diff --git a/commit_extractor_test.go b/commit_extractor_test.go index 5e251b3c..bfde4bff 100644 --- a/commit_extractor_test.go +++ b/commit_extractor_test.go @@ -20,14 +20,14 @@ func TestCommitExtractor(t *testing.T) { fixtures := []*Commit{ // [0] - &Commit{ + { Type: "foo", Scope: "c", Header: "1", Notes: []*Note{}, }, // [1] - &Commit{ + { Type: "foo", Scope: "b", Header: "2", @@ -37,7 +37,7 @@ func TestCommitExtractor(t *testing.T) { }, }, // [2] - &Commit{ + { Type: "bar", Scope: "d", Header: "3", @@ -47,7 +47,7 @@ func TestCommitExtractor(t *testing.T) { }, }, // [3] - &Commit{ + { Type: "foo", Scope: "a", Header: "4", @@ -56,7 +56,7 @@ func TestCommitExtractor(t *testing.T) { }, }, // [4] - &Commit{ + { Type: "", Scope: "", Header: "Merge1", @@ -67,7 +67,7 @@ func TestCommitExtractor(t *testing.T) { }, }, // [5] - &Commit{ + { Type: "", Scope: "", Header: "Revert1", @@ -81,14 +81,14 @@ func TestCommitExtractor(t *testing.T) { commitGroups, mergeCommits, revertCommits, noteGroups := extractor.Extract(fixtures) assert.Equal([]*CommitGroup{ - &CommitGroup{ + { RawTitle: "bar", Title: "BAR", Commits: []*Commit{ fixtures[2], }, }, - &CommitGroup{ + { RawTitle: "foo", Title: "Foo", Commits: []*Commit{ @@ -108,26 +108,26 @@ func TestCommitExtractor(t *testing.T) { }, revertCommits) assert.Equal([]*NoteGroup{ - &NoteGroup{ + { Title: "note1-title", Notes: []*Note{ fixtures[1].Notes[0], fixtures[2].Notes[0], }, }, - &NoteGroup{ + { Title: "note2-title", Notes: []*Note{ fixtures[1].Notes[1], }, }, - &NoteGroup{ + { Title: "note3-title", Notes: []*Note{ fixtures[2].Notes[1], }, }, - &NoteGroup{ + { Title: "note4-title", Notes: []*Note{ fixtures[3].Notes[0], diff --git a/commit_filter.go b/commit_filter.go index bd7ee797..763d88ee 100644 --- a/commit_filter.go +++ b/commit_filter.go @@ -4,7 +4,11 @@ import ( "strings" ) -func commitFilter(commits []*Commit, filters map[string][]string, noCaseSensitive bool) []*Commit { +func commitFilter(commits []*Commit, filters map[string][]string, noCaseSensitive bool) []*Commit { //nolint:gocyclo + // NOTE(khos2ow): this function is over our cyclomatic complexity goal. + // Be wary when adding branches, and look for functionality that could + // be reasonably moved into an injected dependency. + res := []*Commit{} for _, commit := range commits { diff --git a/commit_filter_test.go b/commit_filter_test.go index ec84ef10..59123bd9 100644 --- a/commit_filter_test.go +++ b/commit_filter_test.go @@ -18,27 +18,27 @@ func TestCommitFilter(t *testing.T) { } fixtures := []*Commit{ - &Commit{ + { Type: "foo", Scope: "hoge", Subject: "1", }, - &Commit{ + { Type: "foo", Scope: "fuga", Subject: "2", }, - &Commit{ + { Type: "bar", Scope: "hoge", Subject: "3", }, - &Commit{ + { Type: "bar", Scope: "fuga", Subject: "4", }, - &Commit{ + { Type: "Bar", Scope: "hogera", Subject: "5", diff --git a/commit_parser.go b/commit_parser.go index f3cc7a8b..8c62c981 100644 --- a/commit_parser.go +++ b/commit_parser.go @@ -80,7 +80,7 @@ func newCommitParser(logger *Logger, client gitcmd.Client, jiraClient JiraClient reRef: regexp.MustCompile("(?i)(" + joinedRefActions + ")\\s?([\\w/\\.\\-]+)?(?:" + joinedIssuePrefix + ")(\\d+)"), reIssue: regexp.MustCompile("(?:" + joinedIssuePrefix + ")(\\d+)"), reNotes: regexp.MustCompile("^(?i)\\s*(" + joinedNoteKeywords + ")[:\\s]+(.*)"), - reMention: regexp.MustCompile("@([\\w-]+)"), + reMention: regexp.MustCompile(`@([\w-]+)`), reJiraIssueDescription: regexp.MustCompile(opts.JiraIssueDescriptionPattern), } } @@ -223,8 +223,8 @@ func (p *commitParser) processHeader(commit *Commit, input string) { commit.Mentions = p.parseMentions(input) // Jira - if commit.JiraIssueId != "" { - p.processJiraIssue(commit, commit.JiraIssueId) + if commit.JiraIssueID != "" { + p.processJiraIssue(commit, commit.JiraIssueID) } } @@ -364,10 +364,10 @@ func (p *commitParser) uniqMentions(mentions []string) []string { return arr } -func (p *commitParser) processJiraIssue(commit *Commit, issueId string) { - issue, err := p.jiraClient.GetJiraIssue(commit.JiraIssueId) +func (p *commitParser) processJiraIssue(commit *Commit, issueID string) { + issue, err := p.jiraClient.GetJiraIssue(commit.JiraIssueID) if err != nil { - p.logger.Error(fmt.Sprintf("Failed to parse Jira story %s: %s\n", issueId, err)) + p.logger.Error(fmt.Sprintf("Failed to parse Jira story %s: %s\n", issueID, err)) return } commit.Type = p.config.Options.JiraTypeMaps[issue.Fields.Type.Name] diff --git a/commit_parser_test.go b/commit_parser_test.go index defc7357..b81aca71 100644 --- a/commit_parser_test.go +++ b/commit_parser_test.go @@ -33,7 +33,7 @@ func TestCommitParserParse(t *testing.T) { mock, nil, &Config{ Options: &Options{ CommitFilters: map[string][]string{ - "Type": []string{ + "Type": { "feat", "fix", "perf", @@ -79,7 +79,7 @@ func TestCommitParserParse(t *testing.T) { commits, err := parser.Parse("HEAD") assert.Nil(err) assert.Equal([]*Commit{ - &Commit{ + { Hash: &Hash{ Long: "65cf1add9735dcc4810dda3312b0792236c97c4e", Short: "65cf1add", @@ -97,7 +97,7 @@ func TestCommitParserParse(t *testing.T) { Merge: nil, Revert: nil, Refs: []*Ref{ - &Ref{ + { Action: "", Ref: "123", Source: "", @@ -111,7 +111,7 @@ func TestCommitParserParse(t *testing.T) { Subject: "Add new feature #123", Body: "", }, - &Commit{ + { Hash: &Hash{ Long: "14ef0b6d386c5432af9292eab3c8314fa3001bc7", Short: "14ef0b6d", @@ -132,24 +132,24 @@ func TestCommitParserParse(t *testing.T) { }, Revert: nil, Refs: []*Ref{ - &Ref{ + { Action: "", Ref: "3", Source: "", }, - &Ref{ + { Action: "Fixes", Ref: "3", Source: "", }, - &Ref{ + { Action: "Closes", Ref: "1", Source: "", }, }, Notes: []*Note{ - &Note{ + { Title: "BREAKING CHANGE", Body: "This is breaking point message.", }, @@ -167,7 +167,7 @@ Closes #1 BREAKING CHANGE: This is breaking point message.`, }, - &Commit{ + { Hash: &Hash{ Long: "809a8280ffd0dadb0f4e7ba9fc835e63c37d6af6", Short: "809a8280", @@ -201,7 +201,7 @@ BREAKING CHANGE: This is breaking point message.`, @hogefuga @FooBarBaz`, }, - &Commit{ + { Hash: &Hash{ Long: "74824d6bd1470b901ec7123d13a76a1b8938d8d0", Short: "74824d6b", @@ -219,19 +219,19 @@ BREAKING CHANGE: This is breaking point message.`, Merge: nil, Revert: nil, Refs: []*Ref{ - &Ref{ + { Action: "Fixes", Ref: "123", Source: "", }, - &Ref{ + { Action: "Closes", Ref: "456", Source: "username/repository", }, }, Notes: []*Note{ - &Note{ + { Title: "BREAKING CHANGE", Body: fmt.Sprintf(`This is multiline breaking change note. It is treated as the body of the Note until a mention or reference appears. @@ -281,7 +281,7 @@ class MyController extends Controller { Fixes #123 Closes username/repository#456`, "```", "```"), }, - &Commit{ + { Hash: &Hash{ Long: "123456789735dcc4810dda3312b0792236c97c4e", Short: "12345678", @@ -381,7 +381,7 @@ func TestCommitParserParseWithJira(t *testing.T) { mock, mockJiraClient{}, &Config{ Options: &Options{ CommitFilters: map[string][]string{ - "Type": []string{ + "Type": { "feat", "fix", "perf", @@ -391,7 +391,7 @@ func TestCommitParserParseWithJira(t *testing.T) { HeaderPattern: "^(?:(\\w*)|(?:\\[(.*)\\])?)\\:\\s(.*)$", HeaderPatternMaps: []string{ "Type", - "JiraIssueId", + "JiraIssueID", "Subject", }, JiraTypeMaps: map[string]string{ @@ -403,7 +403,7 @@ func TestCommitParserParseWithJira(t *testing.T) { commits, err := parser.Parse("HEAD") assert.Nil(err) commit := commits[0] - assert.Equal(commit.JiraIssueId, "JIRA-1111") + assert.Equal(commit.JiraIssueID, "JIRA-1111") assert.Equal(commit.JiraIssue.Type, "Story") assert.Equal(commit.JiraIssue.Summary, "summary of JIRA-1111") assert.Equal(commit.JiraIssue.Description, "description of JIRA-1111") diff --git a/example_test.go b/example_test.go index 931b3bb1..5d9ea93f 100644 --- a/example_test.go +++ b/example_test.go @@ -19,7 +19,7 @@ func Example() { }, Options: &Options{ CommitFilters: map[string][]string{ - "Type": []string{ + "Type": { "feat", "fix", }, diff --git a/fields.go b/fields.go index 123da6c7..213bc719 100644 --- a/fields.go +++ b/fields.go @@ -52,7 +52,7 @@ type NoteGroup struct { Notes []*Note } -// JiraIssue +// JiraIssue is information about a jira ticket (type, summary, description, and labels) type JiraIssue struct { Type string Summary string @@ -69,13 +69,13 @@ type Commit struct { Revert *Revert // If it is not a revert commit, `nil` is assigned Refs []*Ref Notes []*Note - Mentions []string // Name of the user included in the commit header or body + Mentions []string // Name of the user included in the commit header or body JiraIssue *JiraIssue // If no issue id found in header, `nil` is assigned - Header string // (e.g. `feat(core)[RNWY-310]: Add new feature`) - Type string // (e.g. `feat`) - Scope string // (e.g. `core`) - Subject string // (e.g. `Add new feature`) - JiraIssueId string // (e.g. `RNWY-310`) + Header string // (e.g. `feat(core)[RNWY-310]: Add new feature`) + Type string // (e.g. `feat`) + Scope string // (e.g. `core`) + Subject string // (e.g. `Add new feature`) + JiraIssueID string // (e.g. `RNWY-310`) Body string } diff --git a/jira.go b/jira.go index 78afbdd7..c1b1da31 100644 --- a/jira.go +++ b/jira.go @@ -4,6 +4,7 @@ import ( agjira "github.com/andygrunwald/go-jira" ) +// JiraClient is an HTTP client for Jira type JiraClient interface { GetJiraIssue(id string) (*agjira.Issue, error) } @@ -14,11 +15,12 @@ type jiraClient struct { url string } +// NewJiraClient returns an instance of JiraClient func NewJiraClient(config *Config) JiraClient { return jiraClient{ username: config.Options.JiraUsername, - token: config.Options.JiraToken, - url: config.Options.JiraUrl, + token: config.Options.JiraToken, + url: config.Options.JiraURL, } } diff --git a/jira_test.go b/jira_test.go index 30936e29..95290a17 100644 --- a/jira_test.go +++ b/jira_test.go @@ -1,14 +1,15 @@ package chglog import ( - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestJira(t *testing.T) { assert := assert.New(t) - config := &Config { + config := &Config{ Options: &Options{ Processor: nil, NextTag: "", @@ -29,7 +30,7 @@ func TestJira(t *testing.T) { NoteKeywords: nil, JiraUsername: "uuu", JiraToken: "ppp", - JiraUrl: "http://jira.com", + JiraURL: "http://jira.com", JiraTypeMaps: nil, JiraIssueDescriptionPattern: "", }, diff --git a/logger.go b/logger.go index 52003ecb..280543e4 100644 --- a/logger.go +++ b/logger.go @@ -7,7 +7,7 @@ import ( "regexp" "github.com/fatih/color" - emoji "github.com/kyokomi/emoji/v2" + "github.com/kyokomi/emoji/v2" ) // Logger ... @@ -26,7 +26,7 @@ func NewLogger(stdout, stderr io.Writer, silent, noEmoji bool) *Logger { stderr: stderr, silent: silent, noEmoji: noEmoji, - reEmoji: regexp.MustCompile(":[\\w\\+_\\-]+:\\s?"), + reEmoji: regexp.MustCompile(`:[\w\+_\-]+:\s?`), } } diff --git a/logger_test.go b/logger_test.go index 77f5ff4d..5118bfe9 100644 --- a/logger_test.go +++ b/logger_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/fatih/color" - "github.com/stretchr/testify/assert" emoji "github.com/kyokomi/emoji/v2" + "github.com/stretchr/testify/assert" ) func TestLoggerLogSilent(t *testing.T) { @@ -40,7 +40,7 @@ func TestLoggerLogNoEmoji(t *testing.T) { stderr := &bytes.Buffer{} logger := NewLogger(stdout, stderr, false, true) logger.Log(":+1:Hello, World! :)") - assert.Equal(fmt.Sprint("Hello, World! :)\n"), stdout.String()) + assert.Equal(fmt.Sprint("Hello, World! :)\n"), stdout.String()) //nolint:gosimple } func TestLoggerError(t *testing.T) { diff --git a/processor.go b/processor.go index 9b46d387..505fec6c 100644 --- a/processor.go +++ b/processor.go @@ -33,8 +33,8 @@ func (p *GitHubProcessor) Bootstrap(config *Config) { p.Host = strings.TrimRight(p.Host, "/") } - p.reMention = regexp.MustCompile("@(\\w+)") - p.reIssue = regexp.MustCompile("(?i)(#|gh-)(\\d+)") + p.reMention = regexp.MustCompile(`@(\w+)`) + p.reIssue = regexp.MustCompile(`(?i)(#|gh-)(\d+)`) } // ProcessCommit ... @@ -88,8 +88,8 @@ func (p *GitLabProcessor) Bootstrap(config *Config) { p.Host = strings.TrimRight(p.Host, "/") } - p.reMention = regexp.MustCompile("@(\\w+)") - p.reIssue = regexp.MustCompile("(?i)#(\\d+)") + p.reMention = regexp.MustCompile(`@(\w+)`) + p.reIssue = regexp.MustCompile(`(?i)#(\d+)`) } // ProcessCommit ... @@ -143,8 +143,8 @@ func (p *BitbucketProcessor) Bootstrap(config *Config) { p.Host = strings.TrimRight(p.Host, "/") } - p.reMention = regexp.MustCompile("@(\\w+)") - p.reIssue = regexp.MustCompile("(?i)#(\\d+)") + p.reMention = regexp.MustCompile(`@(\w+)`) + p.reIssue = regexp.MustCompile(`(?i)#(\d+)`) } // ProcessCommit ... diff --git a/processor_test.go b/processor_test.go index 177f1506..88e8502e 100644 --- a/processor_test.go +++ b/processor_test.go @@ -27,7 +27,7 @@ func TestGitHubProcessor(t *testing.T) { multiline [#789](https://example.com/issues/789) [@foo](https://github.com/foo), [@bar](https://github.com/bar)`, Notes: []*Note{ - &Note{ + { Body: `issue1 [#11](https://example.com/issues/11) issue2 [#22](https://example.com/issues/22) [gh-56](https://example.com/issues/56) hoge fuga`, @@ -42,7 +42,7 @@ issue2 [#22](https://example.com/issues/22) multiline #789 @foo, @bar`, Notes: []*Note{ - &Note{ + { Body: `issue1 #11 issue2 #22 gh-56 hoge fuga`, @@ -89,7 +89,7 @@ func TestGitLabProcessor(t *testing.T) { multiline [#789](https://example.com/issues/789) [@foo](https://gitlab.com/foo), [@bar](https://gitlab.com/bar)`, Notes: []*Note{ - &Note{ + { Body: `issue1 [#11](https://example.com/issues/11) issue2 [#22](https://example.com/issues/22) gh-56 hoge fuga`, @@ -104,7 +104,7 @@ gh-56 hoge fuga`, multiline #789 @foo, @bar`, Notes: []*Note{ - &Note{ + { Body: `issue1 #11 issue2 #22 gh-56 hoge fuga`, @@ -151,7 +151,7 @@ func TestBitbucketProcessor(t *testing.T) { multiline [#789](https://example.com/issues/789/) [@foo](https://bitbucket.org/foo/), [@bar](https://bitbucket.org/bar/)`, Notes: []*Note{ - &Note{ + { Body: `issue1 [#11](https://example.com/issues/11/) issue2 [#22](https://example.com/issues/22/) gh-56 hoge fuga`, @@ -166,7 +166,7 @@ gh-56 hoge fuga`, multiline #789 @foo, @bar`, Notes: []*Note{ - &Note{ + { Body: `issue1 #11 issue2 #22 gh-56 hoge fuga`, diff --git a/tag_reader.go b/tag_reader.go index a1d00d8a..39486073 100644 --- a/tag_reader.go +++ b/tag_reader.go @@ -12,7 +12,6 @@ import ( type tagReader struct { client gitcmd.Client - format string separator string reFilter *regexp.Regexp } @@ -36,7 +35,7 @@ func (r *tagReader) ReadAll() ([]*Tag, error) { tags := []*Tag{} if err != nil { - return tags, fmt.Errorf("failed to get git-tag: %s", err.Error()) + return tags, fmt.Errorf("failed to get git-tag: %w", err) } lines := strings.Split(out, "\n") diff --git a/tag_reader_test.go b/tag_reader_test.go index 15e3b1e1..786951a5 100644 --- a/tag_reader_test.go +++ b/tag_reader_test.go @@ -33,7 +33,7 @@ func TestTagReader(t *testing.T) { assert.Equal( []*Tag{ - &Tag{ + { Name: "hoge_fuga", Subject: "Invalid semver tag name", Date: time.Date(2018, 3, 12, 12, 30, 10, 0, time.UTC), @@ -44,7 +44,7 @@ func TestTagReader(t *testing.T) { Date: time.Date(2018, 2, 3, 12, 30, 10, 0, time.UTC), }, }, - &Tag{ + { Name: "5.0.0-rc.0", Subject: "Release 5.0.0-rc.0", Date: time.Date(2018, 2, 3, 12, 30, 10, 0, time.UTC), @@ -59,7 +59,7 @@ func TestTagReader(t *testing.T) { Date: time.Date(2018, 2, 2, 10, 0, 40, 0, time.UTC), }, }, - &Tag{ + { Name: "4.4.4", Subject: "Release 4.4.4", Date: time.Date(2018, 2, 2, 10, 0, 40, 0, time.UTC), @@ -74,7 +74,7 @@ func TestTagReader(t *testing.T) { Date: time.Date(2018, 2, 2, 0, 0, 0, 0, time.UTC), }, }, - &Tag{ + { Name: "4.4.3", Subject: "This is tag subject", Date: time.Date(2018, 2, 2, 0, 0, 0, 0, time.UTC), @@ -89,7 +89,7 @@ func TestTagReader(t *testing.T) { Date: time.Date(2018, 2, 1, 0, 0, 0, 0, time.UTC), }, }, - &Tag{ + { Name: "v2.0.4-beta.1", Subject: "Release v2.0.4-beta.1", Date: time.Date(2018, 2, 1, 0, 0, 0, 0, time.UTC), @@ -104,11 +104,11 @@ func TestTagReader(t *testing.T) { actual, ) - actual_filtered, err_filtered := newTagReader(client, "^v").ReadAll() - assert.Nil(err_filtered) + actualFiltered, errFiltered := newTagReader(client, "^v").ReadAll() + assert.Nil(errFiltered) assert.Equal( []*Tag{ - &Tag{ + { Name: "v2.0.4-beta.1", Subject: "Release v2.0.4-beta.1", Date: time.Date(2018, 2, 1, 0, 0, 0, 0, time.UTC), @@ -116,6 +116,6 @@ func TestTagReader(t *testing.T) { Previous: nil, }, }, - actual_filtered, + actualFiltered, ) } diff --git a/tag_selector.go b/tag_selector.go index fe17a505..7e292d9e 100644 --- a/tag_selector.go +++ b/tag_selector.go @@ -19,14 +19,16 @@ func (s *tagSelector) Select(tags []*Tag, query string) ([]*Tag, string, error) case 2: old := tokens[0] new := tokens[1] - if old == "" && new == "" { + switch { + case old == "" && new == "": return nil, "", nil - } else if old == "" { + case old == "": return s.selectBeforeTags(tags, new) - } else if new == "" { + case new == "": return s.selectAfterTags(tags, old) + default: + return s.selectRangeTags(tags, tokens[0], tokens[1]) } - return s.selectRangeTags(tags, tokens[0], tokens[1]) } return nil, "", errFailedQueryParse @@ -76,7 +78,8 @@ func (*tagSelector) selectBeforeTags(tags []*Tag, token string) ([]*Tag, string, } func (*tagSelector) selectAfterTags(tags []*Tag, token string) ([]*Tag, string, error) { - var ( + // NOTE(clok): the res slice can range in size based on the token passed in. + var ( //nolint:prealloc res []*Tag from string ) diff --git a/tag_selector_test.go b/tag_selector_test.go index ee8e55b4..a776087b 100644 --- a/tag_selector_test.go +++ b/tag_selector_test.go @@ -12,51 +12,51 @@ func TestTagSelector(t *testing.T) { selector := newTagSelector() fixtures := []*Tag{ - &Tag{Name: "2.2.12-rc.12"}, - &Tag{Name: "2.1.0"}, - &Tag{Name: "v2.0.0-beta.1"}, - &Tag{Name: "v1.2.9"}, - &Tag{Name: "v1.0.0"}, + {Name: "2.2.12-rc.12"}, + {Name: "2.1.0"}, + {Name: "v2.0.0-beta.1"}, + {Name: "v1.2.9"}, + {Name: "v1.0.0"}, } table := map[string][]string{ // Single - "2.2.12-rc.12": []string{ + "2.2.12-rc.12": { "2.2.12-rc.12", "2.1.0", }, - "v2.0.0-beta.1": []string{ + "v2.0.0-beta.1": { "v2.0.0-beta.1", "v1.2.9", }, - "v1.0.0": []string{ + "v1.0.0": { "v1.0.0", "", }, // ~ - "..2.1.0": []string{ + "..2.1.0": { "2.1.0", "v2.0.0-beta.1", "v1.2.9", "v1.0.0", "", }, - "..v1.0.0": []string{ + "..v1.0.0": { "v1.0.0", "", }, // ~ - "v2.0.0-beta.1..": []string{ + "v2.0.0-beta.1..": { "2.2.12-rc.12", "2.1.0", "v2.0.0-beta.1", "v1.2.9", }, - "2.2.12-rc.12..": []string{ + "2.2.12-rc.12..": { "2.2.12-rc.12", "2.1.0", }, - "v1.0.0..": []string{ + "v1.0.0..": { "2.2.12-rc.12", "2.1.0", "v2.0.0-beta.1", @@ -65,7 +65,7 @@ func TestTagSelector(t *testing.T) { "", }, // ~ - "v1.0.0..2.2.12-rc.12": []string{ + "v1.0.0..2.2.12-rc.12": { "2.2.12-rc.12", "2.1.0", "v2.0.0-beta.1", @@ -73,13 +73,13 @@ func TestTagSelector(t *testing.T) { "v1.0.0", "", }, - "v1.0.0..v2.0.0-beta.1": []string{ + "v1.0.0..v2.0.0-beta.1": { "v2.0.0-beta.1", "v1.2.9", "v1.0.0", "", }, - "v1.2.9..2.1.0": []string{ + "v1.2.9..2.1.0": { "2.1.0", "v2.0.0-beta.1", "v1.2.9", From 9a1a9a525c4b0f77663b2a0a54e6623fbcf7a756 Mon Sep 17 00:00:00 2001 From: Khosrow Moossavi Date: Thu, 18 Mar 2021 03:35:57 -0400 Subject: [PATCH 20/82] chore(docs):cleanup Markdown lint issues and line breaks (#122) * chore(docs): Fix markdown lint issues * chore(docs): Adhere to semantic line breaks --- CONTRIBUTING.md | 44 ++++++------ README.md | 186 ++++++++++++++++++++++++++---------------------- 2 files changed, 125 insertions(+), 105 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5e7184c7..717768f2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,22 +2,21 @@ Thank you for contributing `git-chglog` :tada: - ## Templates Please use issue/PR templates which are inserted automatically. - ## Found a Bug? -If you find a bug in the source code, you can help us by [submitting an issue](https://github.com/git-chglog/git-chglog/issues) to our [GitHub Repository](https://github.com/git-chglog/git-chglog). Even better, you can submit a Pull Request with a fix. - +If you find a bug in the source code, you can help us by [submitting an issue] +to our [GitHub Repository]. Even better, you can submit a Pull Request with a +fix. ## Commit Message Format -A format influenced by [Angular commit message](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-format). +A format influenced by [Angular commit message]. -``` +```text : @@ -25,26 +24,31 @@ A format influenced by [Angular commit message](https://github.com/angular/angul
``` - ### Type Must be one of the following: -* **docs:** Documention only changes -* **ci:** Changes to our CI configuration files and scripts -* **chore:** Updating Makefile etc, no production code changes -* **feat:** A new feature -* **fix:** A bug fix -* **perf:** A code change that improves performance -* **refactor:** A code change that neither fixes a bug nor adds a feature -* **style:** Changes that do not affect the meaning of the code -* **test:** Adding missing tests or correcting existing tests - +- **docs:** Documention only changes +- **ci:** Changes to our CI configuration files and scripts +- **chore:** Updating Makefile etc, no production code changes +- **feat:** A new feature +- **fix:** A bug fix +- **perf:** A code change that improves performance +- **refactor:** A code change that neither fixes a bug nor adds a feature +- **style:** Changes that do not affect the meaning of the code +- **test:** Adding missing tests or correcting existing tests ### Footer -The footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any. +The footer should contain a [closing reference to an issue] if any. -The **footer** should contain any information about **Breaking Changes** and is also the place to reference GitHub issues that this commit **Closes**. +The **footer** should contain any information about **Breaking Changes** and is +also the place to reference GitHub issues that this commit **Closes**. -**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this. +**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space +or two newlines. The rest of the commit message is then used for this. + +[submitting an issue]: https://github.com/git-chglog/git-chglog/issues +[GitHub Repository]: https://github.com/git-chglog/git-chglog +[Angular commit message]: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-format +[closing reference to an issue]: https://help.github.com/articles/closing-issues-via-commit-messages/ \ No newline at end of file diff --git a/README.md b/README.md index 9e4fbf00..4f0d0204 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ > CHANGELOG generator implemented in Go (Golang). > _Anytime, anywhere, Write your CHANGELOG._ - ## Table of Contents - [git-chglog](#git-chglog) @@ -45,9 +44,9 @@ - [Templates](#templates) - [Supported Styles](#supported-styles) - [Jira Integration](#jira-integration) - - [1. Change the header parse pattern to recognize Jira issue id in the configure file.](#1-change-the-header-parse-pattern-to-recognize-jira-issue-id-in-the-configure-file) - - [2. Add Jira configuration to the configure file.](#2-add-jira-configuration-to-the-configure-file) - - [3. Update the template to show Jira data.](#3-update-the-template-to-show-jira-data) + - [1. Change the header parse pattern to recognize Jira issue id in the configure file](#1-change-the-header-parse-pattern-to-recognize-jira-issue-id-in-the-configure-file) + - [2. Add Jira configuration to the configure file](#2-add-jira-configuration-to-the-configure-file) + - [3. Update the template to show Jira data](#3-update-the-template-to-show-jira-data) - [FAQ](#faq) - [TODO](#todo) - [Thanks](#thanks) @@ -58,25 +57,22 @@ - [Related Projects](#related-projects) - [License](#license) - - - ## Features -* :recycle: High portability - - It works with single binary. Therefore, any project (environment) can be used. -* :beginner: Simple usability - - The CLI usage is very simple and has low learning costs. - - For example, the simplest command is `$ git-chglog`. -* :rocket: High flexibility - - Commit message format and ... - - CHANGELOG's style (Template) and ... - - etc ... +- :recycle: High portability + - It works with single binary. Therefore, any project (environment) can be used. +- :beginner: Simple usability + - The CLI usage is very simple and has low learning costs. + - For example, the simplest command is `$ git-chglog`. +- :rocket: High flexibility + - Commit message format and ... + - CHANGELOG's style (Template) and ... + - etc ... ## How it works -`git-chglog` internally uses the `git` command to get data to include in the CHANGELOG. -The basic steps are as follows. +`git-chglog` internally uses the `git` command to get data to include in the +CHANGELOG. The basic steps are as follows. 1. Get all the tags. 1. Get the commits contained between `tagA` and `tagB`. @@ -84,7 +80,8 @@ The basic steps are as follows. ## Getting Started -We will start with installation and introduce the steps up to the automatic generation of the configuration file and template. +We will start with installation and introduce the steps up to the automatic generation +of the configuration file and template. ### Installation @@ -93,44 +90,44 @@ Please install `git-chglog` in a way that matches your environment. #### [Homebrew](https://brew.sh) (for macOS users) ```bash -$ brew tap git-chglog/git-chglog -$ brew install git-chglog +brew tap git-chglog/git-chglog +brew install git-chglog ``` #### [Scoop](https://scoop.sh) (for Windows users) -``` -$ scoop install git-chglog +```bash +scoop install git-chglog ``` #### [asdf](https://asdf-vm.com/) ```bash -$ asdf plugin-add git-chglog https://github.com/GoodwayGroup/asdf-git-chglog.git -$ asdf install git-chglog latest +asdf plugin-add git-chglog https://github.com/GoodwayGroup/asdf-git-chglog.git +asdf install git-chglog latest ``` #### Go users ```bash -$ go get -u github.com/git-chglog/git-chglog/cmd/git-chglog +go get -u github.com/git-chglog/git-chglog/cmd/git-chglog ``` --- -If you are using another platform, you can download a binary from the [releases page](https://github.com/git-chglog/git-chglog/releases) and place it in a directory in your `$PATH`. - +If you are using another platform, you can download a binary from the [releases page] +and place it in a directory in your `$PATH`. ### Test Installation -You can check with the following command whether the `git-chglog` command was included in a directory that is in your `$PATH`. +You can check with the following command whether the `git-chglog` command was +included in a directory that is in your `$PATH`. ```bash $ git-chglog --version # outputs the git-chglog version ``` - ### Quick Start `git-chglog` requires configuration files and templates to generate a CHANGELOG. @@ -140,7 +137,7 @@ However, it is a waste of time to create configuration files and templates from Therefore we recommend using the `--init` option which will create them interactively :+1: ```bash -$ git-chglog --init +git-chglog --init ``` ![init option demo](./docs/assets/init.gif) @@ -150,23 +147,25 @@ $ git-chglog --init You are now ready for configuration files and templates! Let's immediately generate a CHANGELOG of your project. -By doing the following simple command, Markdown for your CHANGELOG is displayed on stdout. +By doing the following simple command, Markdown for your CHANGELOG is displayed +on stdout. ```bash -$ git-chglog +git-chglog ``` Use `-o` (`--output`) option if you want to output to a file instead of stdout. ```bash -$ git-chglog -o CHANGELOG.md +git-chglog -o CHANGELOG.md ``` --- You now know basic usage of `git-chglog`! -In order to make a better CHANGELOG, please refer to the following document and customize it. +In order to make a better CHANGELOG, please refer to the following document and +customize it. ## CLI Usage @@ -249,7 +248,8 @@ The table below shows Query patterns and summaries, and Query examples. ## Configuration -The `git-chglog` configuration is a yaml file. The default location is `.chglog/config.yml`. +The `git-chglog` configuration is a yaml file. The default location is +`.chglog/config.yml`. Below is a complete list that you can use with `git-chglog`. @@ -317,7 +317,8 @@ Git execution command. ### `style` -CHANGELOG style. Automatic linking of issues and notices, initial value setting such as merges etc. are done automatically. +CHANGELOG style. Automatic linking of issues and notices, initial value setting +such as merges etc. are done automatically. | Required | Type | Default | Description | |:---------|:-------|:---------|:-------------------------------------------------------| @@ -325,7 +326,8 @@ CHANGELOG style. Automatic linking of issues and notices, initial value setting ### `template` -Path for the template file. It is specified by a relative path from the setting file. Absolute paths are also ok. +Path for the template file. It is specified by a relative path from the setting +file. Absolute paths are also ok. | Required | Type | Default | Description | |:---------|:-------|:---------------------|:------------| @@ -333,7 +335,8 @@ Path for the template file. It is specified by a relative path from the setting ### `info` -Metadata for CHANGELOG. Depending on Style, it is sometimes used in processing, so it is recommended to specify it. +Metadata for CHANGELOG. Depending on Style, it is sometimes used in processing, +so it is recommended to specify it. | Key | Required | Type | Default | Description | |:-----------------|:---------|:-------|:--------------|:-----------------------| @@ -348,10 +351,10 @@ Options used to process commits. Options concerning the acquisition and sort of commits. -| Key | Required | Type | Default | Description | -|:----------|:---------|:------------|:----------|:--------------------------------------------------------------------------------------------------------------------| -| `filters` | N | Map in List | none | Filter by using `Commit` properties and values. Filtering is not done by specifying an empty value. | -| `sort_by` | N | String | `"Scope"` | Property name to use for sorting `Commit`. See [Commit](https://godoc.org/github.com/git-chglog/git-chglog#Commit). | +| Key | Required | Type | Default | Description | +|:----------|:---------|:------------|:----------|:----------------------------------------------------------------------------------------------------| +| `filters` | N | Map in List | none | Filter by using `Commit` properties and values. Filtering is not done by specifying an empty value. | +| `sort_by` | N | String | `"Scope"` | Property name to use for sorting `Commit`. See [Commit]. | #### `options.commit_groups` @@ -417,7 +420,8 @@ Options to detect notes contained in commit bodies. ## Templates -The `git-chglog` template uses the `text/template` package. For basic usage please refer to the following. +The `git-chglog` template uses the `text/template` package. For basic usage please +refer to the following. > [text/template](https://golang.org/pkg/text/template/) @@ -498,20 +502,20 @@ See the godoc [RenderData][doc-render-data] documentation for available variable | [GitLab](https://about.gitlab.com/) | :white_check_mark: | Mentions automatic link. Automatic link to references. | | [Bitbucket](https://bitbucket.org/product) | :white_check_mark: | Mentions automatic link. Automatic link to references. | -> :memo: Even with styles that are not yet supported, it is possible to make ordinary CHANGELOG. - +> :memo: Even with styles that are not yet supported, it is possible to make +ordinary CHANGELOG. ## Jira Integration - -Jira is a popular project management tool. When a project uses Jira to track feature development and bug fixes, -it may also want to generate change log based information stored in Jira. With embedding a Jira story id in git -commit header, the git-chglog tool may automatically fetch data of the story from Jira, those data then can be -used to render the template. +Jira is a popular project management tool. When a project uses Jira to track +feature development and bug fixes, it may also want to generate change log based +information stored in Jira. With embedding a Jira story id in git commit header, +the git-chglog tool may automatically fetch data of the story from Jira, those +data then can be used to render the template. Take the following steps to add Jira integration: -#### 1. Change the header parse pattern to recognize Jira issue id in the configure file. +### 1. Change the header parse pattern to recognize Jira issue id in the configure file __Where Jira issue is identical Jira story.__ @@ -528,10 +532,10 @@ The following is a sample pattern: This sample pattern can match both forms of commit headers: -* `feat: new feature of something` -* `[JIRA-ID]: something` +- `feat: new feature of something` +- `[JIRA-ID]: something` -#### 2. Add Jira configuration to the configure file. +### 2. Add Jira configuration to the configure file The following is a sample: @@ -548,20 +552,22 @@ The following is a sample: description_pattern: "(.*)" ``` -Here you need to define Jira URL, access username and token (password). If you don't want to -write your Jira access credential in configure file, you may define them with environment variables: -`JIRA_URL`, `JIRA_USERNAME` and `JIRA_TOKEN`. +Here you need to define Jira URL, access username and token (password). If you +don't want to write your Jira access credential in configure file, you may define +them with environment variables: `JIRA_URL`, `JIRA_USERNAME` and `JIRA_TOKEN`. -You also needs to define a issue type map. In above sample, Jira issue type `Task` will be -mapped to `fix` and `Story` will be mapped to `feat`. +You also needs to define a issue type map. In above sample, Jira issue type `Task` +will be mapped to `fix` and `Story` will be mapped to `feat`. -As a Jira story's description could be very long, you might not want to include the entire -description into change log. In that case, you may define `description_pattern` like above, -so that only content embraced with ` ... ` will be included. +As a Jira story's description could be very long, you might not want to include +the entire description into change log. In that case, you may define `description_pattern` +like above, so that only content embraced with ` ... ` +will be included. -#### 3. Update the template to show Jira data. +### 3. Update the template to show Jira data -In the template, if a commit contains a Jira issue id, then you may show Jira data. For example: +In the template, if a commit contains a Jira issue id, then you may show Jira +data. For example: ```markdown {{ range .CommitGroups -}} @@ -576,19 +582,20 @@ In the template, if a commit contains a Jira issue id, then you may show Jira da Within a `Commit`, the following Jira data can be used in template: -* `.JiraIssue.Summary` - Summary of the Jira story -* `.JiraIssue.Description` - Description of the Jira story -* `.JiraIssue.Type` - Original type of the Jira story, and `.Type` will be mapped type. -* `.JiraIssue.Labels` - A list of strings, each is a Jira label. - +- `.JiraIssue.Summary` - Summary of the Jira story +- `.JiraIssue.Description` - Description of the Jira story +- `.JiraIssue.Type` - Original type of the Jira story, and `.Type` will be mapped type. +- `.JiraIssue.Labels` - A list of strings, each is a Jira label. ## FAQ
Why do not you output files by default? - This is not for the purpose of completely automating the generation of CHANGELOG files, it is only for assisting generation. + This is not for the purpose of completely automating the generation of CHANGELOG + files, it is only for assisting generation. - It is ideal to describe everything included in CHANGELOG in your commits. But actually it is very difficult to do it perfectly. + It is ideal to describe everything included in CHANGELOG in your commits. But + actually it is very difficult to do it perfectly. There are times when you need to edit the generated output to write a great CHANGELOG. @@ -604,12 +611,13 @@ Within a `Commit`, the following Jira data can be used in template: You can create CHANGELOG containing `2.0.0` as follows. ```bash - $ git-chglog --next-tag 2.0.0 -o CHANGELOG.md - $ git commit -am "release 2.0.0" - $ git tag 2.0.0 + git-chglog --next-tag 2.0.0 -o CHANGELOG.md + git commit -am "release 2.0.0" + git tag 2.0.0 ``` - The point to notice is that before actually creating a tag with `git`, it is conveying the next version with `--next-tag` :+1: + The point to notice is that before actually creating a tag with `git`, it is + conveying the next version with `--next-tag` :+1: This is a step that is necessary for project operation in many cases.
@@ -620,21 +628,23 @@ Within a `Commit`, the following Jira data can be used in template: Yes, it can be solved by use the `--tag-filter-pattern` flag. For example, the following command will only include tags starting with "v": + ```bash - $ git-chglog --tag-filter-pattern '^v' + git-chglog --tag-filter-pattern '^v' ``` +
## TODO -* [x] Windows Support -* [x] More styles (GitHub, GitLab, Bitbucket :tada:) -* [ ] Snippetization of configuration files (improvement of reusability) -* [ ] More test test test ... (and example) +- [x] Windows Support +- [x] More styles (GitHub, GitLab, Bitbucket :tada:) +- [ ] Snippetization of configuration files (improvement of reusability) +- [ ] More test test test ... (and example) ## Thanks -`git-chglog` is inspired by [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog). Thank you! +`git-chglog` is inspired by [conventional-changelog]. Thank you! ## Contributing @@ -647,12 +657,12 @@ We alway welcome your contributions :clap: 1. Create a feature branch :coffee: 1. Run test suite with the `$ make test` command and confirm that it passes :zap: 1. Run linters with the `$ make lint` command and confirm it passes :broom: - - The project uses [golangci-lint](https://golangci-lint.run/usage/install/#local-installation) + - The project uses [golangci-lint] 1. Commit your changes :memo: 1. Rebase your local changes against the `master` branch :bulb: 1. Create new Pull Request :love_letter: -Bugs, feature requests and comments are more than welcome in the [issues](https://github.com/git-chglog/git-chglog/issues). +Bugs, feature requests and comments are more than welcome in the [issues]. ### Feedback @@ -668,13 +678,19 @@ See [CHANGELOG.md](./CHANGELOG.md) ## Related Projects -* [git-chglog/artwork](https://github.com/git-chglog/artwork) - Assets for `git-chglog`. +- [git-chglog/artwork] - Assets for `git-chglog`. ## License [MIT © tsuyoshiwada](./LICENSE) +[releases page]: https://github.com/git-chglog/git-chglog/releases +[Commit]: https://godoc.org/github.com/git-chglog/git-chglog#Commit [doc-commit]: https://godoc.org/github.com/git-chglog/git-chglog#Commit [doc-commit-group]: https://godoc.org/github.com/git-chglog/git-chglog#CommitGroup [doc-ref]: https://godoc.org/github.com/git-chglog/git-chglog#Ref [doc-render-data]: https://godoc.org/github.com/git-chglog/git-chglog#RenderData +[conventional-changelog]: https://github.com/conventional-changelog/conventional-changelog +[golangci-lint]: https://golangci-lint.run/usage/install/#local-installation +[issues]: https://github.com/git-chglog/git-chglog/issues +[git-chglog/artwork]: https://github.com/git-chglog/artwork From ebff3d0beb8ce113edf0e62f3ca3c59a2ec20b05 Mon Sep 17 00:00:00 2001 From: Louis DeLosSantos Date: Sat, 20 Mar 2021 18:21:47 -0400 Subject: [PATCH 21/82] feat: allow tag sorting by semver (#124) Relates to #123. While this does not introduce "per-branch" tag parsing it does allow an alternative tag sorting method which maybe a better solution. With this commit the user can decide to sort the tags by semver instead of dates. This is useful where repositories are utilizing a stable branch model and back-ports are interleaved with new releases. For example, if your mainline is on v3.0.0 with it's last release 1/1/2021 and a back-port release of v2.0.1 is released on 1/2/2021, sorting by semver will correctly order the change log producing v2.0.1 -> v2.0.1 -> v3.0.0 This functionality is completely opt-in and defaults to the original "date" sorting Signed-off-by: ldelossa --- README.md | 9 +++ chglog.go | 3 +- chglog_test.go | 2 + cmd/git-chglog/config.go | 16 +++++ go.mod | 1 + go.sum | 2 + tag_reader.go | 41 ++++++++++++- tag_reader_test.go | 125 ++++++++++++++++++++++++++++++++++++--- 8 files changed, 187 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 4f0d0204..ae43bbaf 100644 --- a/README.md +++ b/README.md @@ -263,6 +263,7 @@ info: options: tag_filter_pattern: '^v' + sort: "date" commits: filters: @@ -347,6 +348,14 @@ so it is recommended to specify it. Options used to process commits. +#### `options.sort` + +Options concerning the acquisition and sort of commits. + +| Required | Type | Default | Description | +|:---------|:------------|:----------|:--------------------------------------------------------------------------------------------------------------------| +| N | String | `"date"` | Defines how tags are sorted in the generated change log. Values: "date", "semver". | + #### `options.commits` Options concerning the acquisition and sort of commits. diff --git a/chglog.go b/chglog.go index f71f8095..68c8b3f3 100644 --- a/chglog.go +++ b/chglog.go @@ -20,6 +20,7 @@ type Options struct { Processor Processor NextTag string // Treat unreleased commits as specified tags (EXPERIMENTAL) TagFilterPattern string // Filter tag by regexp + Sort string // Specify how to sort tags; currently supports "date" (default) or by "semver". NoCaseSensitive bool // Filter commits in a case insensitive way CommitFilters map[string][]string // Filter by using `Commit` properties and values. Filtering is not done by specifying an empty value CommitSortBy string // Property name to use for sorting `Commit` (e.g. `Scope`) @@ -120,7 +121,7 @@ func NewGenerator(logger *Logger, config *Config) *Generator { return &Generator{ client: client, config: config, - tagReader: newTagReader(client, config.Options.TagFilterPattern), + tagReader: newTagReader(client, config.Options.TagFilterPattern, config.Options.Sort), tagSelector: newTagSelector(), commitParser: newCommitParser(logger, client, jiraClient, config), commitExtractor: newCommitExtractor(config.Options), diff --git a/chglog_test.go b/chglog_test.go index 47082a36..3c1486bc 100644 --- a/chglog_test.go +++ b/chglog_test.go @@ -215,6 +215,7 @@ change message.`) RepositoryURL: "https://github.com/git-chglog/git-chglog", }, Options: &Options{ + Sort: "date", CommitFilters: map[string][]string{ "Type": { "feat", @@ -329,6 +330,7 @@ func TestGeneratorWithNextTag(t *testing.T) { RepositoryURL: "https://github.com/git-chglog/git-chglog", }, Options: &Options{ + Sort: "date", NextTag: "3.0.0", CommitFilters: map[string][]string{ "Type": { diff --git a/cmd/git-chglog/config.go b/cmd/git-chglog/config.go index b3992b86..f00985ba 100644 --- a/cmd/git-chglog/config.go +++ b/cmd/git-chglog/config.go @@ -72,6 +72,7 @@ type JiraOptions struct { // Options ... type Options struct { TagFilterPattern string `yaml:"tag_filter_pattern"` + Sort string `yaml:"sort"` Commits CommitOptions `yaml:"commits"` CommitGroups CommitGroupOptions `yaml:"commit_groups"` Header PatternOptions `yaml:"header"` @@ -122,6 +123,7 @@ func (config *Config) Normalize(ctx *CLIContext) error { } config.normalizeStyle() + config.normalizeTagSortBy() return nil } @@ -138,6 +140,19 @@ func (config *Config) normalizeStyle() { } } +func (config *Config) normalizeTagSortBy() { + switch { + case config.Options.Sort == "": + config.Options.Sort = "date" + case strings.EqualFold(config.Options.Sort, "date"): + config.Options.Sort = "date" + case strings.EqualFold(config.Options.Sort, "semver"): + config.Options.Sort = "semver" + default: + config.Options.Sort = "date" + } +} + // For GitHub func (config *Config) normalizeStyleOfGitHub() { opts := config.Options @@ -293,6 +308,7 @@ func (config *Config) Convert(ctx *CLIContext) *chglog.Config { Options: &chglog.Options{ NextTag: ctx.NextTag, TagFilterPattern: ctx.TagFilterPattern, + Sort: opts.Sort, NoCaseSensitive: ctx.NoCaseSensitive, Paths: ctx.Paths, CommitFilters: opts.Commits.Filters, diff --git a/go.mod b/go.mod index b9a8a7e3..c56b0ef7 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.16 require ( github.com/AlecAivazis/survey/v2 v2.2.9 github.com/andygrunwald/go-jira v1.13.0 + github.com/coreos/go-semver v0.3.0 github.com/fatih/color v1.10.0 github.com/imdario/mergo v0.3.12 github.com/kyokomi/emoji/v2 v2.2.8 diff --git a/go.sum b/go.sum index 2e16e071..c6593849 100644 --- a/go.sum +++ b/go.sum @@ -5,6 +5,8 @@ github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8 h1:xzYJEypr/85nB github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc= github.com/andygrunwald/go-jira v1.13.0 h1:vvIImGgX32bHfoiyUwkNo+/YrPnRczNarvhLOncP6dE= github.com/andygrunwald/go-jira v1.13.0/go.mod h1:jYi4kFDbRPZTJdJOVJO4mpMMIwdB+rcZwSO58DzPd2I= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/tag_reader.go b/tag_reader.go index 39486073..754cb633 100644 --- a/tag_reader.go +++ b/tag_reader.go @@ -7,6 +7,7 @@ import ( "strings" "time" + "github.com/coreos/go-semver/semver" gitcmd "github.com/tsuyoshiwada/go-gitcmd" ) @@ -14,13 +15,15 @@ type tagReader struct { client gitcmd.Client separator string reFilter *regexp.Regexp + sortBy string } -func newTagReader(client gitcmd.Client, filterPattern string) *tagReader { +func newTagReader(client gitcmd.Client, filterPattern string, sort string) *tagReader { return &tagReader{ client: client, separator: "@@__CHGLOG__@@", reFilter: regexp.MustCompile(filterPattern), + sortBy: sort, } } @@ -71,12 +74,36 @@ func (r *tagReader) ReadAll() ([]*Tag, error) { }) } - r.sortTags(tags) + switch r.sortBy { + case "date": + r.sortTags(tags) + case "semver": + r.filterSemVerTags(&tags) + r.sortTagsBySemver(tags) + } r.assignPreviousAndNextTag(tags) return tags, nil } +func (*tagReader) filterSemVerTags(tags *[]*Tag) { + // filter out any non-semver tags + for i, t := range *tags { + // remove leading v, since its so + // common. + name := t.Name + if strings.HasPrefix(name, "v") { + name = strings.TrimPrefix(name, "v") + } + + // attempt semver parse, if not successful + // remove it from tags slice. + if _, err := semver.NewVersion(name); err != nil { + *tags = append((*tags)[:i], (*tags)[i+1:]...) + } + } +} + func (*tagReader) parseRefname(input string) string { return strings.Replace(input, "refs/tags/", "", 1) } @@ -124,3 +151,13 @@ func (*tagReader) sortTags(tags []*Tag) { return !tags[i].Date.Before(tags[j].Date) }) } + +func (*tagReader) sortTagsBySemver(tags []*Tag) { + sort.Slice(tags, func(i, j int) bool { + semver1 := strings.TrimPrefix(tags[i].Name, "v") + semver2 := strings.TrimPrefix(tags[j].Name, "v") + v1 := semver.New(semver1) + v2 := semver.New(semver2) + return v2.LessThan(*v1) + }) +} diff --git a/tag_reader_test.go b/tag_reader_test.go index 786951a5..43cd308d 100644 --- a/tag_reader_test.go +++ b/tag_reader_test.go @@ -21,6 +21,7 @@ func TestTagReader(t *testing.T) { "refs/tags/v2.0.4-beta.1@@__CHGLOG__@@Release v2.0.4-beta.1@@__CHGLOG__@@Thu Feb 1 00:00:00 2018 +0000@@__CHGLOG__@@", "refs/tags/4.4.3@@__CHGLOG__@@This is tag subject@@__CHGLOG__@@@@__CHGLOG__@@Fri Feb 2 00:00:00 2018 +0000", "refs/tags/4.4.4@@__CHGLOG__@@Release 4.4.4@@__CHGLOG__@@Fri Feb 2 10:00:40 2018 +0000@@__CHGLOG__@@", + "refs/tags/v2.0.4-beta.2@@__CHGLOG__@@Release v2.0.4-beta.2@@__CHGLOG__@@Sat Feb 3 12:15:00 2018 +0000@@__CHGLOG__@@", "refs/tags/5.0.0-rc.0@@__CHGLOG__@@Release 5.0.0-rc.0@@__CHGLOG__@@Sat Feb 3 12:30:10 2018 +0000@@__CHGLOG__@@", "refs/tags/hoge_fuga@@__CHGLOG__@@Invalid semver tag name@@__CHGLOG__@@Mon Mar 12 12:30:10 2018 +0000@@__CHGLOG__@@", "hoge@@__CHGLOG__@@", @@ -28,7 +29,7 @@ func TestTagReader(t *testing.T) { }, } - actual, err := newTagReader(client, "").ReadAll() + actual, err := newTagReader(client, "", "date").ReadAll() assert.Nil(err) assert.Equal( @@ -53,6 +54,21 @@ func TestTagReader(t *testing.T) { Subject: "Invalid semver tag name", Date: time.Date(2018, 3, 12, 12, 30, 10, 0, time.UTC), }, + Previous: &RelateTag{ + Name: "v2.0.4-beta.2", + Subject: "Release v2.0.4-beta.2", + Date: time.Date(2018, 2, 3, 12, 15, 0, 0, time.UTC), + }, + }, + { + Name: "v2.0.4-beta.2", + Subject: "Release v2.0.4-beta.2", + Date: time.Date(2018, 2, 3, 12, 15, 0, 0, time.UTC), + Next: &RelateTag{ + Name: "5.0.0-rc.0", + Subject: "Release 5.0.0-rc.0", + Date: time.Date(2018, 2, 3, 12, 30, 10, 0, time.UTC), + }, Previous: &RelateTag{ Name: "4.4.4", Subject: "Release 4.4.4", @@ -64,9 +80,9 @@ func TestTagReader(t *testing.T) { Subject: "Release 4.4.4", Date: time.Date(2018, 2, 2, 10, 0, 40, 0, time.UTC), Next: &RelateTag{ - Name: "5.0.0-rc.0", - Subject: "Release 5.0.0-rc.0", - Date: time.Date(2018, 2, 3, 12, 30, 10, 0, time.UTC), + Name: "v2.0.4-beta.2", + Subject: "Release v2.0.4-beta.2", + Date: time.Date(2018, 2, 3, 12, 15, 0, 0, time.UTC), }, Previous: &RelateTag{ Name: "4.4.3", @@ -104,15 +120,106 @@ func TestTagReader(t *testing.T) { actual, ) - actualFiltered, errFiltered := newTagReader(client, "^v").ReadAll() + actual, err = newTagReader(client, "", "semver").ReadAll() + assert.Nil(err) + + assert.Equal( + []*Tag{ + { + Name: "5.0.0-rc.0", + Subject: "Release 5.0.0-rc.0", + Date: time.Date(2018, 2, 3, 12, 30, 10, 0, time.UTC), + Next: nil, + Previous: &RelateTag{ + Name: "4.4.4", + Subject: "Release 4.4.4", + Date: time.Date(2018, 2, 2, 10, 0, 40, 0, time.UTC), + }, + }, + { + Name: "4.4.4", + Subject: "Release 4.4.4", + Date: time.Date(2018, 2, 2, 10, 0, 40, 0, time.UTC), + Next: &RelateTag{ + Name: "5.0.0-rc.0", + Subject: "Release 5.0.0-rc.0", + Date: time.Date(2018, 2, 3, 12, 30, 10, 0, time.UTC), + }, + Previous: &RelateTag{ + Name: "4.4.3", + Subject: "This is tag subject", + Date: time.Date(2018, 2, 2, 0, 0, 0, 0, time.UTC), + }, + }, + { + Name: "4.4.3", + Subject: "This is tag subject", + Date: time.Date(2018, 2, 2, 0, 0, 0, 0, time.UTC), + Next: &RelateTag{ + Name: "4.4.4", + Subject: "Release 4.4.4", + Date: time.Date(2018, 2, 2, 10, 0, 40, 0, time.UTC), + }, + Previous: &RelateTag{ + Name: "v2.0.4-beta.2", + Subject: "Release v2.0.4-beta.2", + Date: time.Date(2018, 2, 3, 12, 15, 0, 0, time.UTC), + }, + }, + { + Name: "v2.0.4-beta.2", + Subject: "Release v2.0.4-beta.2", + Date: time.Date(2018, 2, 3, 12, 15, 0, 0, time.UTC), + Next: &RelateTag{ + Name: "4.4.3", + Subject: "This is tag subject", + Date: time.Date(2018, 2, 2, 0, 0, 0, 0, time.UTC), + }, + Previous: &RelateTag{ + Name: "v2.0.4-beta.1", + Subject: "Release v2.0.4-beta.1", + Date: time.Date(2018, 2, 1, 0, 0, 0, 0, time.UTC), + }, + }, + { + Name: "v2.0.4-beta.1", + Subject: "Release v2.0.4-beta.1", + Date: time.Date(2018, 2, 1, 0, 0, 0, 0, time.UTC), + Next: &RelateTag{ + Name: "v2.0.4-beta.2", + Subject: "Release v2.0.4-beta.2", + Date: time.Date(2018, 2, 3, 12, 15, 0, 0, time.UTC), + }, + Previous: nil, + }, + }, + actual, + ) + + actualFiltered, errFiltered := newTagReader(client, "^v", "date").ReadAll() assert.Nil(errFiltered) assert.Equal( []*Tag{ { - Name: "v2.0.4-beta.1", - Subject: "Release v2.0.4-beta.1", - Date: time.Date(2018, 2, 1, 0, 0, 0, 0, time.UTC), - Next: nil, + Name: "v2.0.4-beta.2", + Subject: "Release v2.0.4-beta.2", + Date: time.Date(2018, 2, 3, 12, 15, 0, 0, time.UTC), + Next: nil, + Previous: &RelateTag{ + Name: "v2.0.4-beta.1", + Subject: "Release v2.0.4-beta.1", + Date: time.Date(2018, 2, 1, 0, 0, 0, 0, time.UTC), + }, + }, + { + Name: "v2.0.4-beta.1", + Subject: "Release v2.0.4-beta.1", + Date: time.Date(2018, 2, 1, 0, 0, 0, 0, time.UTC), + Next: &RelateTag{ + Name: "v2.0.4-beta.2", + Subject: "Release v2.0.4-beta.2", + Date: time.Date(2018, 2, 3, 12, 15, 0, 0, time.UTC), + }, Previous: nil, }, }, From 9926e07971eb10f03497768655e661ce356b396f Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Sat, 20 Mar 2021 21:57:06 -0500 Subject: [PATCH 22/82] chore: bumps version to v0.12.0 --- cmd/git-chglog/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/git-chglog/version.go b/cmd/git-chglog/version.go index 11f8414f..da70d6c8 100644 --- a/cmd/git-chglog/version.go +++ b/cmd/git-chglog/version.go @@ -1,4 +1,4 @@ package main // Version of git-chglog cli client -const Version = "v0.11.2" +const Version = "v0.12.0" From 2caa67cc76bbabdff8466d2bd78e18fd2391fa7b Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Sat, 20 Mar 2021 22:20:14 -0500 Subject: [PATCH 23/82] chore: update changelog for v0.12.0 --- CHANGELOG.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91038d7b..9d11499a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,20 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html ## [Unreleased] + +## [v0.12.0] - 2021-03-20 +### Chore +- bumps version to v0.12.0 +- bump golang to 1.16 ([#118](https://github.com/git-chglog/git-chglog/issues/118)) +- **ci:** add golangci-lint action and apply linting changes ([#120](https://github.com/git-chglog/git-chglog/issues/120)) + +### Features +- allow tag sorting by semver ([#124](https://github.com/git-chglog/git-chglog/issues/124)) + +### BREAKING CHANGE + +`JiraIssueId` has been renamed to `JiraIssueID`. This impacts the value for `pattern_maps` in `config.yml`. + ## [v0.11.2] - 2021-03-13 ### Bug Fixes @@ -182,7 +196,8 @@ https://github.com/git-chglog/git-chglog/releases/download/v/git-chglog - First implement -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.11.2...HEAD +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.12.0...HEAD +[v0.12.0]: https://github.com/git-chglog/git-chglog/compare/v0.11.2...v0.12.0 [v0.11.2]: https://github.com/git-chglog/git-chglog/compare/v0.11.1...v0.11.2 [v0.11.1]: https://github.com/git-chglog/git-chglog/compare/v0.11.0...v0.11.1 [v0.11.0]: https://github.com/git-chglog/git-chglog/compare/v0.10.0...v0.11.0 From 9a0d5847458a53f499200b3538db68e54ee5d910 Mon Sep 17 00:00:00 2001 From: "Mason J. Katz" Date: Mon, 22 Mar 2021 14:04:57 -0700 Subject: [PATCH 24/82] feat: add support for rendering .Body after .Subject as part of list (#121) When attempting to render a commit body below the summary line of the commit there are two problems: 1) The text needs to be indented two spaces to appear as part of the list. 2) Notes (e.g. BREAKING CHANGE) are included in the body and end up being repeating in a Notes section (if this is part of your template). To address #1 add an `indent` func to the template parsing. To address #2 add a `TrimmedBody` to the `Commit` fields. The `TrimmedBody` will include everything in `Body` but not any `Ref`s, `Note`s, `Mention`s, `CoAuthors`, or `Signers`. Both the CoAuthors and Signers are now first class in the Commit struct. With both of these a template block like: ``` {{ if .TrimmedBody -}} {{ indent .TrimmedBody 2 }} {{ end -}} ``` Will render the trimmed down body section as intended. See TestGeneratorWithTimmedBody for example of desired output. --- chglog.go | 8 ++++ chglog_test.go | 79 ++++++++++++++++++++++++++++++++++++ commit_parser.go | 88 ++++++++++++++++++++++++++++++++++------ commit_parser_test.go | 35 +++++++++------- fields.go | 9 ++++ testdata/trimmed_body.md | 48 ++++++++++++++++++++++ 6 files changed, 239 insertions(+), 28 deletions(-) create mode 100644 testdata/trimmed_body.md diff --git a/chglog.go b/chglog.go index 68c8b3f3..76a8fbec 100644 --- a/chglog.go +++ b/chglog.go @@ -343,6 +343,14 @@ func (gen *Generator) render(w io.Writer, unreleased *Unreleased, versions []*Ve } return "" }, + // indent all lines of s n spaces + "indent": func(s string, n int) string { + if len(s) == 0 { + return "" + } + pad := strings.Repeat(" ", n) + return pad + strings.ReplaceAll(s, "\n", "\n"+pad) + }, } fname := filepath.Base(gen.config.Template) diff --git a/chglog_test.go b/chglog_test.go index 3c1486bc..864a7434 100644 --- a/chglog_test.go +++ b/chglog_test.go @@ -463,3 +463,82 @@ func TestGeneratorWithTagFiler(t *testing.T) { [Unreleased]: https://github.com/git-chglog/git-chglog/compare/v1.0.0...HEAD`, strings.TrimSpace(buf.String())) } + +func TestGeneratorWithTimmedBody(t *testing.T) { + assert := assert.New(t) + testName := "trimmed_body" + + setup(testName, func(commit commitFunc, tag tagFunc, _ gitcmd.Client) { + commit("2018-01-01 00:00:00", "feat: single line commit", "") + commit("2018-01-01 00:01:00", "feat: multi-line commit", ` +More details about the change and why it went in. + +BREAKING CHANGE: + +When using .TrimmedBody Notes are not included and can only appear in the Notes section. + +Signed-off-by: First Last + +Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>`) + + commit("2018-01-01 00:00:00", "feat: another single line commit", "") + tag("1.0.0") + }) + + gen := NewGenerator(NewLogger(os.Stdout, os.Stderr, false, true), + &Config{ + Bin: "git", + WorkingDir: filepath.Join(testRepoRoot, testName), + Template: filepath.Join(cwd, "testdata", testName+".md"), + Info: &Info{ + Title: "CHANGELOG Example", + RepositoryURL: "https://github.com/git-chglog/git-chglog", + }, + Options: &Options{ + CommitFilters: map[string][]string{ + "Type": { + "feat", + }, + }, + CommitSortBy: "Scope", + CommitGroupBy: "Type", + CommitGroupSortBy: "Title", + CommitGroupTitleMaps: map[string]string{ + "feat": "Features", + }, + HeaderPattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$", + HeaderPatternMaps: []string{ + "Type", + "Scope", + "Subject", + }, + NoteKeywords: []string{ + "BREAKING CHANGE", + }, + }, + }) + + buf := &bytes.Buffer{} + err := gen.Generate(buf, "") + output := strings.ReplaceAll(strings.TrimSpace(buf.String()), "\r\n", "\n") + + assert.Nil(err) + assert.Equal(` +## [Unreleased] + + + +## 1.0.0 - 2018-01-01 +### Features +- another single line commit +- multi-line commit + More details about the change and why it went in. +- single line commit + +### BREAKING CHANGE + +When using .TrimmedBody Notes are not included and can only appear in the Notes section. + + +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/1.0.0...HEAD`, output) +} diff --git a/commit_parser.go b/commit_parser.go index 8c62c981..0bb67f83 100644 --- a/commit_parser.go +++ b/commit_parser.go @@ -59,6 +59,8 @@ type commitParser struct { reIssue *regexp.Regexp reNotes *regexp.Regexp reMention *regexp.Regexp + reSignOff *regexp.Regexp + reCoAuthor *regexp.Regexp reJiraIssueDescription *regexp.Regexp } @@ -81,6 +83,8 @@ func newCommitParser(logger *Logger, client gitcmd.Client, jiraClient JiraClient reIssue: regexp.MustCompile("(?:" + joinedIssuePrefix + ")(\\d+)"), reNotes: regexp.MustCompile("^(?i)\\s*(" + joinedNoteKeywords + ")[:\\s]+(.*)"), reMention: regexp.MustCompile(`@([\w-]+)`), + reSignOff: regexp.MustCompile(`Signed-off-by:\s+([\p{L}\s\-\[\]]+)\s+<([\w+\-\[\].@]+)>`), + reCoAuthor: regexp.MustCompile(`Co-authored-by:\s+([\p{L}\s\-\[\]]+)\s+<([\w+\-\[\].@]+)>`), reJiraIssueDescription: regexp.MustCompile(opts.JiraIssueDescriptionPattern), } } @@ -228,6 +232,36 @@ func (p *commitParser) processHeader(commit *Commit, input string) { } } +func (p *commitParser) extractLineMetadata(commit *Commit, line string) bool { + meta := false + + refs := p.parseRefs(line) + if len(refs) > 0 { + meta = true + commit.Refs = append(commit.Refs, refs...) + } + + mentions := p.parseMentions(line) + if len(mentions) > 0 { + meta = true + commit.Mentions = append(commit.Mentions, mentions...) + } + + coAuthors := p.parseCoAuthors(line) + if len(coAuthors) > 0 { + meta = true + commit.CoAuthors = append(commit.CoAuthors, coAuthors...) + } + + signers := p.parseSigners(line) + if len(signers) > 0 { + meta = true + commit.Signers = append(commit.Signers, signers...) + } + + return meta +} + func (p *commitParser) processBody(commit *Commit, input string) { input = convNewline(input, "\n") @@ -237,30 +271,29 @@ func (p *commitParser) processBody(commit *Commit, input string) { // notes & refs & mentions commit.Notes = []*Note{} inNote := false + trim := false fenceDetector := newMdFenceDetector() lines := strings.Split(input, "\n") + // body without notes & refs & mentions + trimmedBody := make([]string, 0, len(lines)) + for _, line := range lines { + if !inNote { + trim = false + } fenceDetector.Update(line) - if !fenceDetector.InCodeblock() { - refs := p.parseRefs(line) - if len(refs) > 0 { - inNote = false - commit.Refs = append(commit.Refs, refs...) - } - - mentions := p.parseMentions(line) - if len(mentions) > 0 { - inNote = false - commit.Mentions = append(commit.Mentions, mentions...) - } + if !fenceDetector.InCodeblock() && p.extractLineMetadata(commit, line) { + trim = true + inNote = false } - + // Q: should this check also only be outside of code blocks? res := p.reNotes.FindAllStringSubmatch(line, -1) if len(res) > 0 { inNote = true + trim = true for _, r := range res { commit.Notes = append(commit.Notes, &Note{ Title: r[1], @@ -271,8 +304,13 @@ func (p *commitParser) processBody(commit *Commit, input string) { last := commit.Notes[len(commit.Notes)-1] last.Body = last.Body + "\n" + line } + + if !trim { + trimmedBody = append(trimmedBody, line) + } } + commit.TrimmedBody = strings.TrimSpace(strings.Join(trimmedBody, "\n")) p.trimSpaceInNotes(commit) } @@ -317,6 +355,30 @@ func (p *commitParser) parseRefs(input string) []*Ref { return refs } +func (p *commitParser) parseSigners(input string) []Contact { + res := p.reSignOff.FindAllStringSubmatch(input, -1) + contacts := make([]Contact, len(res)) + + for i, r := range res { + contacts[i].Name = r[1] + contacts[i].Email = r[2] + } + + return contacts +} + +func (p *commitParser) parseCoAuthors(input string) []Contact { + res := p.reCoAuthor.FindAllStringSubmatch(input, -1) + contacts := make([]Contact, len(res)) + + for i, r := range res { + contacts[i].Name = r[1] + contacts[i].Email = r[2] + } + + return contacts +} + func (p *commitParser) parseMentions(input string) []string { res := p.reMention.FindAllStringSubmatch(input, -1) mentions := make([]string, len(res)) diff --git a/commit_parser_test.go b/commit_parser_test.go index b81aca71..93eec18b 100644 --- a/commit_parser_test.go +++ b/commit_parser_test.go @@ -103,13 +103,14 @@ func TestCommitParserParse(t *testing.T) { Source: "", }, }, - Notes: []*Note{}, - Mentions: []string{}, - Header: "feat(*): Add new feature #123", - Type: "feat", - Scope: "*", - Subject: "Add new feature #123", - Body: "", + Notes: []*Note{}, + Mentions: []string{}, + Header: "feat(*): Add new feature #123", + Type: "feat", + Scope: "*", + Subject: "Add new feature #123", + Body: "", + TrimmedBody: "", }, { Hash: &Hash{ @@ -166,6 +167,7 @@ Fixes #3 Closes #1 BREAKING CHANGE: This is breaking point message.`, + TrimmedBody: `This is body message.`, }, { Hash: &Hash{ @@ -200,6 +202,7 @@ BREAKING CHANGE: This is breaking point message.`, @tsuyoshiwada @hogefuga @FooBarBaz`, + TrimmedBody: `Has mention body`, }, { Hash: &Hash{ @@ -280,6 +283,7 @@ class MyController extends Controller { Fixes #123 Closes username/repository#456`, "```", "```"), + TrimmedBody: `This mixed body message.`, }, { Hash: &Hash{ @@ -300,14 +304,15 @@ Closes username/repository#456`, "```", "```"), Revert: &Revert{ Header: "fix(core): commit message", }, - Refs: []*Ref{}, - Notes: []*Note{}, - Mentions: []string{}, - Header: "Revert \"fix(core): commit message\"", - Type: "", - Scope: "", - Subject: "", - Body: "This reverts commit f755db78dcdf461dc42e709b3ab728ceba353d1d.", + Refs: []*Ref{}, + Notes: []*Note{}, + Mentions: []string{}, + Header: "Revert \"fix(core): commit message\"", + Type: "", + Scope: "", + Subject: "", + Body: "This reverts commit f755db78dcdf461dc42e709b3ab728ceba353d1d.", + TrimmedBody: "This reverts commit f755db78dcdf461dc42e709b3ab728ceba353d1d.", }, }, commits) } diff --git a/fields.go b/fields.go index 213bc719..2d68b885 100644 --- a/fields.go +++ b/fields.go @@ -8,6 +8,12 @@ type Hash struct { Short string } +// Contact of co-authors and signers +type Contact struct { + Name string + Email string +} + // Author of commit type Author struct { Name string @@ -70,6 +76,8 @@ type Commit struct { Refs []*Ref Notes []*Note Mentions []string // Name of the user included in the commit header or body + CoAuthors []Contact // (e.g. `Co-authored-by: user `) + Signers []Contact // (e.g. `Signed-off-by: user `) JiraIssue *JiraIssue // If no issue id found in header, `nil` is assigned Header string // (e.g. `feat(core)[RNWY-310]: Add new feature`) Type string // (e.g. `feat`) @@ -77,6 +85,7 @@ type Commit struct { Subject string // (e.g. `Add new feature`) JiraIssueID string // (e.g. `RNWY-310`) Body string + TrimmedBody string // Body without any Notes/Refs/Mentions/CoAuthors/Signers } // CommitGroup is a collection of commits grouped according to the `CommitGroupBy` option diff --git a/testdata/trimmed_body.md b/testdata/trimmed_body.md new file mode 100644 index 00000000..047a1581 --- /dev/null +++ b/testdata/trimmed_body.md @@ -0,0 +1,48 @@ +{{ if .Versions -}} + +## [Unreleased] + +{{ if .Unreleased.CommitGroups -}} +{{ range .Unreleased.CommitGroups -}} +### {{ .Title }} +{{ range .Commits -}} +- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} +{{ if .TrimmedBody -}} +{{ indent .TrimmedBody 2 }} +{{ end -}} +{{ end }} +{{ end -}} +{{ end -}} +{{ end -}} + +{{ range .Versions }} + +## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }} +{{ range .CommitGroups -}} +### {{ .Title }} +{{ range .Commits -}} +- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} +{{ if .TrimmedBody -}} +{{ indent .TrimmedBody 2 }} +{{ end -}} +{{ end }} +{{ end -}} + +{{- if .NoteGroups -}} +{{ range .NoteGroups -}} +### {{ .Title }} +{{ range .Notes }} +{{ .Body }} +{{ end }} +{{ end -}} +{{ end -}} +{{ end -}} + +{{- if .Versions }} +[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD +{{ range .Versions -}} +{{ if .Tag.Previous -}} +[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }} +{{ end -}} +{{ end -}} +{{ end -}} From 3113e4252402b25bfd0e8f8f7d975d955e33321d Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Tue, 23 Mar 2021 14:11:35 -0500 Subject: [PATCH 25/82] chore: use ldflags to pass version to build process (#127) --- Makefile | 6 +++++- cmd/git-chglog/main.go | 5 ++++- cmd/git-chglog/version.go | 4 ---- 3 files changed, 9 insertions(+), 6 deletions(-) delete mode 100644 cmd/git-chglog/version.go diff --git a/Makefile b/Makefile index fa11f871..02281c52 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +VERSION?=$$(git describe --tags --always) + +LDFLAGS="-X main.version=$(VERSION)" + .PHONY: clean clean: rm -rf ./dist/ @@ -7,7 +11,7 @@ clean: .PHONY: build build: - go build -o git-chglog ./cmd/git-chglog + go build -ldflags=$(LDFLAGS) -o git-chglog ./cmd/git-chglog .PHONY: test test: diff --git a/cmd/git-chglog/main.go b/cmd/git-chglog/main.go index 562a0a78..8503b149 100644 --- a/cmd/git-chglog/main.go +++ b/cmd/git-chglog/main.go @@ -12,6 +12,9 @@ import ( "github.com/urfave/cli/v2" ) +// version is passed in via LDFLAGS main.version +var version string + // CreateApp creates and initializes CLI application // with description, flags, version, etc. func CreateApp(actionFunc cli.ActionFunc) *cli.App { @@ -74,7 +77,7 @@ func CreateApp(actionFunc cli.ActionFunc) *cli.App { app := cli.NewApp() app.Name = "git-chglog" app.Usage = "todo usage for git-chglog" - app.Version = Version + app.Version = version app.Flags = []cli.Flag{ // init diff --git a/cmd/git-chglog/version.go b/cmd/git-chglog/version.go deleted file mode 100644 index da70d6c8..00000000 --- a/cmd/git-chglog/version.go +++ /dev/null @@ -1,4 +0,0 @@ -package main - -// Version of git-chglog cli client -const Version = "v0.12.0" From 4d8b2b6be794b14fb959ea917f75eec974b79b14 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Tue, 23 Mar 2021 14:14:31 -0500 Subject: [PATCH 26/82] chore: update changelog for v0.13.0 --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d11499a..413a6068 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html ## [Unreleased] + +## [v0.13.0] - 2021-03-23 +### Features +- add support for rendering .Body after .Subject as part of list ([#121](https://github.com/git-chglog/git-chglog/issues/121)) + ## [v0.12.0] - 2021-03-20 ### Chore @@ -196,7 +201,8 @@ https://github.com/git-chglog/git-chglog/releases/download/v/git-chglog - First implement -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.12.0...HEAD +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.13.0...HEAD +[v0.13.0]: https://github.com/git-chglog/git-chglog/compare/v0.12.0...v0.13.0 [v0.12.0]: https://github.com/git-chglog/git-chglog/compare/v0.11.2...v0.12.0 [v0.11.2]: https://github.com/git-chglog/git-chglog/compare/v0.11.1...v0.11.2 [v0.11.1]: https://github.com/git-chglog/git-chglog/compare/v0.11.0...v0.11.1 From b44eb4e011bbca8a23a6b3217abc6ec7d6d93833 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Wed, 24 Mar 2021 16:59:08 -0500 Subject: [PATCH 27/82] chore(CHANGELOG): regenerate CHANGELOG with type-scope and KAC template (#129) --- .chglog/CHANGELOG.tpl.md | 7 ++ .chglog/config.yml | 5 +- CHANGELOG.md | 191 +++++++++++++++++++++++++++++++++------ Makefile | 4 +- 4 files changed, 174 insertions(+), 33 deletions(-) diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md index 389e9789..5683d039 100755 --- a/.chglog/CHANGELOG.tpl.md +++ b/.chglog/CHANGELOG.tpl.md @@ -29,6 +29,13 @@ {{ end }} {{ end -}} +{{- if .MergeCommits -}} +### Pull Requests +{{ range .MergeCommits -}} +- {{ .Header }} +{{ end }} +{{ end -}} + {{- if .NoteGroups -}} {{ range .NoteGroups -}} ### {{ .Title }} diff --git a/.chglog/config.yml b/.chglog/config.yml index abfce168..074a182c 100755 --- a/.chglog/config.yml +++ b/.chglog/config.yml @@ -11,16 +11,19 @@ options: - fix - perf - refactor + - chore commit_groups: title_maps: feat: Features fix: Bug Fixes perf: Performance Improvements refactor: Code Refactoring + chore: Chores header: - pattern: "^(\\w*)\\:\\s(.*)$" + pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$" pattern_maps: - Type + - Scope - Subject notes: keywords: diff --git a/CHANGELOG.md b/CHANGELOG.md index 413a6068..d01f571c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,18 +1,21 @@ -# CHANGELOG -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html) - ## [Unreleased] + ## [v0.13.0] - 2021-03-23 +### Chores +- update changelog for v0.13.0 +- use ldflags to pass version to build process ([#127](https://github.com/git-chglog/git-chglog/issues/127)) + ### Features - add support for rendering .Body after .Subject as part of list ([#121](https://github.com/git-chglog/git-chglog/issues/121)) + ## [v0.12.0] - 2021-03-20 -### Chore +### Chores +- update changelog for v0.12.0 - bumps version to v0.12.0 - bump golang to 1.16 ([#118](https://github.com/git-chglog/git-chglog/issues/118)) - **ci:** add golangci-lint action and apply linting changes ([#120](https://github.com/git-chglog/git-chglog/issues/120)) @@ -24,39 +27,79 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html `JiraIssueId` has been renamed to `JiraIssueID`. This impacts the value for `pattern_maps` in `config.yml`. +* chore(ci): add golangci-lint action + +* chore(lint): address errcheck lint failures + +* chore(lint): address misspell lint failures + +* chore(lint): address gocritic lint failures + +* chore(lint): address golint lint failures + +* chore(lint): address structcheck lint failures + +* chore(lint): address gosimple lint failures + +* chore(lint): address gofmt lint failures + +* chore(ci): port to official golangci-lint github action + +* Update golangci configuration for better coverage + + ## [v0.11.2] - 2021-03-13 ### Bug Fixes - `--template` and `--repository-url` flags not being used ([#119](https://github.com/git-chglog/git-chglog/issues/119)) +### Chores +- update changelog for v0.11.2 +- bumps version to v0.11.2 + + ## [v0.11.1] - 2021-03-12 - ### Bug Fixes -- **short flags**: correctly define cli flags with shorthands ([#117](https://github.com/git-chglog/git-chglog/issues/117)) +- **short flags:** correctly define cli flags with shorthands ([#117](https://github.com/git-chglog/git-chglog/issues/117)) + +### Chores +- update readme and changelog for v0.11.1 +- bumps version to v0.11.1 + ## [v0.11.0] - 2021-03-12 +### Bug Fixes +- **deps:** update all non-major dependencies ([#115](https://github.com/git-chglog/git-chglog/issues/115)) +- **deps:** update module gopkg.in/kyokomi/emoji.v1 to github.com/kyokomi/emoji/v2 ([#109](https://github.com/git-chglog/git-chglog/issues/109)) +- **deps:** update module github.com/urfave/cli to v2 ([#107](https://github.com/git-chglog/git-chglog/issues/107)) +- **deps:** update module github.com/stretchr/testify to v1.7.0 ([#103](https://github.com/git-chglog/git-chglog/issues/103)) +- **deps:** update module gopkg.in/alecaivazis/survey.v1 to github.com/AlecAivazis/survey/v2 ([#108](https://github.com/git-chglog/git-chglog/issues/108)) +- **init:** support OptionAnswer form in survey/v2 ([#113](https://github.com/git-chglog/git-chglog/issues/113)) + +### Chores +- update changelog for v0.11.0 +- bumps version to v0.11.0 +- **deps:** add initial renovatebot configuration ([#102](https://github.com/git-chglog/git-chglog/issues/102)) + ### Features - add Jira integration ([#52](https://github.com/git-chglog/git-chglog/issues/52)) +- **flag:** --path filtering - refs ([#62](https://github.com/git-chglog/git-chglog/issues/62)). Closes [#35](https://github.com/git-chglog/git-chglog/issues/35) + ## [v0.10.0] - 2021-01-16 - -### BREAKING CHANGE -We adapted the naming schema of the uploaded binaries by adding a `v` prefix for tags/versions starting from `v0.10.0`: -``` -# up to 0.9.1 -https://github.com/git-chglog/git-chglog/releases/download//git-chglog__ - -# from v0.10.0 -https://github.com/git-chglog/git-chglog/releases/download/v/git-chglog__ - -``` - ### Bug Fixes - ignore only git-chglog binary in root and not subfolder +### Chores +- update changelog for v0.10.0 +- bumps version to v0.10.0 +- sorts changelog desc and excludes Merge commits +- fix Makefile typo ([#82](https://github.com/git-chglog/git-chglog/issues/82)) +- **asdf:** add asdf install support to README ([#79](https://github.com/git-chglog/git-chglog/issues/79)) + ### Features - Adds 'Custom' sort_type to CommitGroup ([#69](https://github.com/git-chglog/git-chglog/issues/69)) - enable tag_filter_pattern in config options ([#72](https://github.com/git-chglog/git-chglog/issues/72)) @@ -65,6 +108,16 @@ https://github.com/git-chglog/git-chglog/releases/download/v/git-chglog - add upperFirst template function - Add emoji format and some formatters in variables +### Reverts +- Revert "ci: switches to personal GH Token for brew cross repo releases" +- ci: switches to personal GH Token for brew cross repo releases + +### Pull Requests +- Merge pull request [#65](https://github.com/git-chglog/git-chglog/issues/65) from barryib/case-sensitive-option +- Merge pull request [#59](https://github.com/git-chglog/git-chglog/issues/59) from momotaro98/feature/add-emoji-template-in-init +- Merge pull request [#66](https://github.com/git-chglog/git-chglog/issues/66) from barryib/add-upper-first-func +- Merge pull request [#68](https://github.com/git-chglog/git-chglog/issues/68) from unixorn/tweak-readme + ## [0.9.1] - 2019-09-23 @@ -77,49 +130,84 @@ https://github.com/git-chglog/git-chglog/releases/download/v/git-chglog ### Features - Add --tag-filter-pattern flag. +### Pull Requests +- Merge pull request [#44](https://github.com/git-chglog/git-chglog/issues/44) from evanchaoli/tag-filter +- Merge pull request [#41](https://github.com/git-chglog/git-chglog/issues/41) from StanleyGoldman/fixing-tests-windows +- Merge pull request [#37](https://github.com/git-chglog/git-chglog/issues/37) from ForkingSyndrome/master + ## [0.8.0] - 2019-02-23 ### Features - add the contains, hasPrefix, hasSuffix, replace, lower and upper functions to the template functions map +### Pull Requests +- Merge pull request [#34](https://github.com/git-chglog/git-chglog/issues/34) from atosatto/template-functions + ## [0.7.1] - 2018-11-10 ### Bug Fixes - Panic occured when exec --next-tag with HEAD with tag +### Pull Requests +- Merge pull request [#31](https://github.com/git-chglog/git-chglog/issues/31) from drubin/patch-1 +- Merge pull request [#30](https://github.com/git-chglog/git-chglog/issues/30) from vvakame/fix-panic + ## [0.7.0] - 2018-05-06 ### Bug Fixes - Remove accidentally added `Unreleased.Tag` +### Chores +- Update `changelog` task in Makefile + ### Features - Add URL of output example for template style - Add `--next-tag` flag (experimental) +### Pull Requests +- Merge pull request [#22](https://github.com/git-chglog/git-chglog/issues/22) from git-chglog/feat/add-preview-style-link +- Merge pull request [#21](https://github.com/git-chglog/git-chglog/issues/21) from git-chglog/feat/next-tag + ## [0.6.0] - 2018-05-04 +### Chores +- Update CHANGELOG template format + ### Features - Add tag name header id for keep-a-changelog template +### Pull Requests +- Merge pull request [#20](https://github.com/git-chglog/git-chglog/issues/20) from git-chglog/feat/kac-template-title-id + ## [0.5.0] - 2018-05-04 ### Bug Fixes - Add unreleased commits section to keep-a-changelog template [#15](https://github.com/git-chglog/git-chglog/issues/15) +### Chores +- Update CHANGELOG template format + ### Features - Update template format to human readable - Add `Unreleased` field to `RenderData` +### Pull Requests +- Merge pull request [#19](https://github.com/git-chglog/git-chglog/issues/19) from git-chglog/fix/unreleased-commits +- Merge pull request [#18](https://github.com/git-chglog/git-chglog/issues/18) from ringohub/master + ## [0.4.0] - 2018-04-14 ### Features -- Add support for Bitbucket :tada: +- Add support for Bitbucket + +### Pull Requests +- Merge pull request [#17](https://github.com/git-chglog/git-chglog/issues/17) from git-chglog/feat/bitbucket @@ -127,42 +215,69 @@ https://github.com/git-chglog/git-chglog/releases/download/v/git-chglog ### Features - Change to kindly error message when git-tag does not exist +### Pull Requests +- Merge pull request [#16](https://github.com/git-chglog/git-chglog/issues/16) from git-chglog/fix/empty-tag-handling + ## [0.3.2] - 2018-04-02 ### Bug Fixes - Fix color output bug in windows help command +### Pull Requests +- Merge pull request [#14](https://github.com/git-chglog/git-chglog/issues/14) from git-chglog/fix/windows-help-color + ## [0.3.1] - 2018-03-15 ### Bug Fixes -- Fix preview string of commit subject ([@kt3k](https://github.com/kt3k)) +- fix preview string of commit subject + +### Pull Requests +- Merge pull request [#13](https://github.com/git-chglog/git-chglog/issues/13) from kt3k/feature/fix-preview ## [0.3.0] - 2018-03-12 +### Chores +- Add helper task for generate CHANGELOG + ### Features -- Add support for GitLab :tada: +- Add support for GitLab + +### Pull Requests +- Merge pull request [#12](https://github.com/git-chglog/git-chglog/issues/12) from git-chglog/feat/gitlab ## [0.2.0] - 2018-03-02 +### Chores +- Fix release flow (retry) +- Add AppVeyor config + ### Features - Add template for `Keep a changelog` to the `--init` option - Supports vim like `j/k` keybind with item selection of `--init` -### Bug Fixes -- Support Windows colors :tada: ([@mattn](https://github.com/mattn)) -- Fixed several bugs in Windows +### Pull Requests +- Merge pull request [#11](https://github.com/git-chglog/git-chglog/issues/11) from git-chglog/develop +- Merge pull request [#10](https://github.com/git-chglog/git-chglog/issues/10) from mattn/fix-test +- Merge pull request [#9](https://github.com/git-chglog/git-chglog/issues/9) from mattn/windows-color ## [0.1.0] - 2018-02-25 ### Bug Fixes +- Fix a bug that `Commit.Revert.Header` is not converted by `GitHubProcessor` - Fix error message when `Tag` can not be acquired - Fix `Revert` of template created by Initializer +### Chores +- Fix release scripts +- Remove unnecessary task +- Add coverage measurement task for local confirmation +- Change release method of git tag on TravisCI + ### Code Refactoring - Refactor `Initializer` to testable @@ -172,14 +287,19 @@ https://github.com/git-chglog/git-chglog/releases/download/v/git-chglog - Add Git Basic to commit message format - Add preview to the commit message format of `--init` option +### Pull Requests +- Merge pull request [#8](https://github.com/git-chglog/git-chglog/issues/8) from git-chglog/feat/0.0.3 +- Merge pull request [#6](https://github.com/git-chglog/git-chglog/issues/6) from git-chglog/chore/coverage +- Merge pull request [#4](https://github.com/git-chglog/git-chglog/issues/4) from paralax/patch-1 +- Merge pull request [#5](https://github.com/git-chglog/git-chglog/issues/5) from git-chglog/develop +- Merge pull request [#1](https://github.com/git-chglog/git-chglog/issues/1) from git-chglog/develop + ## [0.0.2] - 2018-02-18 -### Bug Fixes -- Fix a bug that `Commit.Revert.Header` is not converted by `GitHubProcessor` - -### Features -- Add preview to the commit message format of `--init` option +### Chores +- Fix release script +- Add release process @@ -187,6 +307,17 @@ https://github.com/git-chglog/git-chglog/releases/download/v/git-chglog ### Bug Fixes - Fix parsing of revert and body +### Chores +- Fix timezone in TravisCI +- Add travis configuration +- Add Makefile for task management +- Fix testcase depending on datetime +- Update vendor packages +- Add e2e tests +- Setup gitignore +- Initial commit +- **editor:** Add Editorconfig + ### Code Refactoring - Fix typo - Change to return an error if corresponding commit is empty diff --git a/Makefile b/Makefile index 02281c52..cc5b6c0b 100644 --- a/Makefile +++ b/Makefile @@ -22,8 +22,8 @@ install: go install ./cmd/git-chglog .PHONY: changelog -changelog: - @git-chglog --next-tag $(tag) $(tag) +changelog: build + ./git-chglog --next-tag $(VERSION) -o CHANGELOG.md .PHONY: lint lint: From 34b9d5c997038d93c9fc441db5c3228142320792 Mon Sep 17 00:00:00 2001 From: Khosrow Moossavi Date: Thu, 25 Mar 2021 23:48:53 -0400 Subject: [PATCH 28/82] ci: deprecate AppVoyer integration (#128) With the migration to GitHub Action, there's no need to continue to use AppVoyer to only test on Windows, as it's covered by corresponding new jobs. Signed-off-by: Khosrow Moossavi --- .appveyor.yml | 21 --------------------- .github/workflows/test.yml | 2 -- chglog_test.go | 31 +++++++++++++++++++------------ 3 files changed, 19 insertions(+), 35 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index d7176220..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,21 +0,0 @@ -version: "{build}" - -clone_depth: 1 -clone_folder: c:\gopath\src\github.com\git-chglog\git-chglog - -environment: - GOPATH: c:\gopath - -install: - - echo %PATH% - - echo %GOPATH% - - go version - - go env - - set PATH=%PATH%;%GOPATH%\bin - -test_script: - - go build github.com/git-chglog/git-chglog/cmd/git-chglog - - for /f "" %%G in ('go list github.com/git-chglog/git-chglog/...') do ( go test -v %%G & IF ERRORLEVEL == 1 EXIT 1) - -build: off -deploy: off diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b7f9c396..3327c1ab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,8 +13,6 @@ on: jobs: unit: runs-on: ubuntu-20.04 - strategy: - fail-fast: true steps: - name: Checkout uses: actions/checkout@v2 diff --git a/chglog_test.go b/chglog_test.go index 864a7434..969ee3b7 100644 --- a/chglog_test.go +++ b/chglog_test.go @@ -89,9 +89,11 @@ func TestGeneratorNotFoundTags(t *testing.T) { buf := &bytes.Buffer{} err := gen.Generate(buf, "") + expected := strings.TrimSpace(buf.String()) + assert.Error(err) assert.Contains(err.Error(), "git-tag does not exist") - assert.Equal("", buf.String()) + assert.Equal("", expected) } func TestGeneratorNotFoundCommits(t *testing.T) { @@ -116,8 +118,10 @@ func TestGeneratorNotFoundCommits(t *testing.T) { buf := &bytes.Buffer{} err := gen.Generate(buf, "foo") + expected := strings.TrimSpace(buf.String()) + assert.Error(err) - assert.Equal("", buf.String()) + assert.Equal("", expected) } func TestGeneratorNotFoundCommitsOne(t *testing.T) { @@ -171,9 +175,11 @@ func TestGeneratorNotFoundCommitsOne(t *testing.T) { buf := &bytes.Buffer{} err := gen.Generate(buf, "foo") + expected := strings.TrimSpace(buf.String()) + assert.Error(err) assert.Contains(err.Error(), "\"foo\" was not found") - assert.Equal("", buf.String()) + assert.Equal("", expected) } func TestGeneratorWithTypeScopeSubject(t *testing.T) { @@ -257,7 +263,7 @@ change message.`) buf := &bytes.Buffer{} err := gen.Generate(buf, "") - output := strings.ReplaceAll(strings.TrimSpace(buf.String()), "\r\n", "\n") + expected := strings.TrimSpace(buf.String()) assert.Nil(err) assert.Equal(` @@ -303,7 +309,7 @@ Online breaking change message. [Unreleased]: https://github.com/git-chglog/git-chglog/compare/2.0.0-beta.0...HEAD [2.0.0-beta.0]: https://github.com/git-chglog/git-chglog/compare/1.1.0...2.0.0-beta.0 -[1.1.0]: https://github.com/git-chglog/git-chglog/compare/1.0.0...1.1.0`, output) +[1.1.0]: https://github.com/git-chglog/git-chglog/compare/1.0.0...1.1.0`, expected) } func TestGeneratorWithNextTag(t *testing.T) { @@ -354,7 +360,7 @@ func TestGeneratorWithNextTag(t *testing.T) { buf := &bytes.Buffer{} err := gen.Generate(buf, "") - output := strings.ReplaceAll(strings.TrimSpace(buf.String()), "\r\n", "\n") + expected := strings.TrimSpace(buf.String()) assert.Nil(err) assert.Equal(` @@ -381,11 +387,11 @@ func TestGeneratorWithNextTag(t *testing.T) { [Unreleased]: https://github.com/git-chglog/git-chglog/compare/3.0.0...HEAD [3.0.0]: https://github.com/git-chglog/git-chglog/compare/2.0.0...3.0.0 -[2.0.0]: https://github.com/git-chglog/git-chglog/compare/1.0.0...2.0.0`, output) +[2.0.0]: https://github.com/git-chglog/git-chglog/compare/1.0.0...2.0.0`, expected) buf = &bytes.Buffer{} err = gen.Generate(buf, "3.0.0") - output = strings.ReplaceAll(strings.TrimSpace(buf.String()), "\r\n", "\n") + expected = strings.TrimSpace(buf.String()) assert.Nil(err) assert.Equal(` @@ -399,7 +405,7 @@ func TestGeneratorWithNextTag(t *testing.T) { [Unreleased]: https://github.com/git-chglog/git-chglog/compare/3.0.0...HEAD -[3.0.0]: https://github.com/git-chglog/git-chglog/compare/2.0.0...3.0.0`, output) +[3.0.0]: https://github.com/git-chglog/git-chglog/compare/2.0.0...3.0.0`, expected) } func TestGeneratorWithTagFiler(t *testing.T) { @@ -447,6 +453,7 @@ func TestGeneratorWithTagFiler(t *testing.T) { buf := &bytes.Buffer{} err := gen.Generate(buf, "") + expected := strings.TrimSpace(buf.String()) assert.Nil(err) assert.Equal(` @@ -460,7 +467,7 @@ func TestGeneratorWithTagFiler(t *testing.T) { - **core:** version dev-1.0.0 -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v1.0.0...HEAD`, strings.TrimSpace(buf.String())) +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v1.0.0...HEAD`, expected) } @@ -520,7 +527,7 @@ Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users. buf := &bytes.Buffer{} err := gen.Generate(buf, "") - output := strings.ReplaceAll(strings.TrimSpace(buf.String()), "\r\n", "\n") + expected := strings.TrimSpace(buf.String()) assert.Nil(err) assert.Equal(` @@ -540,5 +547,5 @@ Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users. When using .TrimmedBody Notes are not included and can only appear in the Notes section. -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/1.0.0...HEAD`, output) +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/1.0.0...HEAD`, expected) } From e523fd471ab8312c649c32c6e8a11deb3a1f2659 Mon Sep 17 00:00:00 2001 From: Sander Blue Date: Sun, 28 Mar 2021 22:17:21 -0500 Subject: [PATCH 29/82] feat: add `--sort [TYPE]` flag (#78) * feat(chglog): add --sort flag * chore(sort): update README with --sort usage --- README.md | 1 + cmd/git-chglog/config.go | 2 +- cmd/git-chglog/context.go | 1 + cmd/git-chglog/main.go | 8 ++++++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ae43bbaf..17bbb9c9 100644 --- a/README.md +++ b/README.md @@ -198,6 +198,7 @@ OPTIONS: --jira-url value Jira URL [$JIRA_URL] --jira-username value Jira username [$JIRA_USERNAME] --jira-token value Jira token [$JIRA_TOKEN] + --sort value Specify how to sort tags; currently supports "date" or by "semver" (default: date) --help, -h show help (default: false) --version, -v print the version (default: false) diff --git a/cmd/git-chglog/config.go b/cmd/git-chglog/config.go index f00985ba..98e22fbd 100644 --- a/cmd/git-chglog/config.go +++ b/cmd/git-chglog/config.go @@ -308,7 +308,7 @@ func (config *Config) Convert(ctx *CLIContext) *chglog.Config { Options: &chglog.Options{ NextTag: ctx.NextTag, TagFilterPattern: ctx.TagFilterPattern, - Sort: opts.Sort, + Sort: orValue(ctx.Sort, opts.Sort), NoCaseSensitive: ctx.NoCaseSensitive, Paths: ctx.Paths, CommitFilters: opts.Commits.Filters, diff --git a/cmd/git-chglog/context.go b/cmd/git-chglog/context.go index 65dea9db..39042663 100644 --- a/cmd/git-chglog/context.go +++ b/cmd/git-chglog/context.go @@ -24,6 +24,7 @@ type CLIContext struct { JiraToken string JiraURL string Paths []string + Sort string } // InitContext ... diff --git a/cmd/git-chglog/main.go b/cmd/git-chglog/main.go index 8503b149..7ad21f7d 100644 --- a/cmd/git-chglog/main.go +++ b/cmd/git-chglog/main.go @@ -178,6 +178,13 @@ func CreateApp(actionFunc cli.ActionFunc) *cli.App { EnvVars: []string{"JIRA_TOKEN"}, }, + // sort + &cli.StringFlag{ + Name: "sort", + Usage: "Specify how to sort tags; currently supports \"date\" or by \"semver\"", + DefaultText: "date", + }, + // help & version cli.HelpFlag, cli.VersionFlag, @@ -240,6 +247,7 @@ func AppAction(c *cli.Context) error { JiraToken: c.String("jira-token"), JiraURL: c.String("jira-url"), Paths: c.StringSlice("path"), + Sort: c.String("sort"), }, fs, NewConfigLoader(), From 4f3fdc4dae556dba128de4e3cb9af057da9c2d25 Mon Sep 17 00:00:00 2001 From: Trent Albright Date: Sun, 28 Mar 2021 23:18:36 -0400 Subject: [PATCH 30/82] feat: add sprig template functions support (#131) * cherry-pick from delmendo * add tests, docs, and lift hermetic restriction * remove duplicate funcs that are now provided by sprig * switch func load order to allow built-ins precedence * Update chglog.go Co-authored-by: Dirk Elmendorf --- README.md | 23 ++++++------ chglog.go | 15 ++------ chglog_test.go | 82 +++++++++++++++++++++++++++++++++++++++++- go.mod | 1 + go.sum | 25 ++++++++++++- testdata/with_sprig.md | 57 +++++++++++++++++++++++++++++ 6 files changed, 176 insertions(+), 27 deletions(-) create mode 100644 testdata/with_sprig.md diff --git a/README.md b/README.md index 17bbb9c9..fa6cab54 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Coverage Status](https://img.shields.io/coveralls/github/git-chglog/git-chglog.svg?style=flat-square)](https://coveralls.io/github/git-chglog/git-chglog?branch=master) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/git-chglog/git-chglog/blob/master/LICENSE) -> CHANGELOG generator implemented in Go (Golang). +> CHANGELOG generator implemented in Go (Golang). > _Anytime, anywhere, Write your CHANGELOG._ ## Table of Contents @@ -130,7 +130,7 @@ $ git-chglog --version ### Quick Start -`git-chglog` requires configuration files and templates to generate a CHANGELOG. +`git-chglog` requires configuration files and templates to generate a CHANGELOG. However, it is a waste of time to create configuration files and templates from scratch. @@ -146,7 +146,7 @@ git-chglog --init You are now ready for configuration files and templates! -Let's immediately generate a CHANGELOG of your project. +Let's immediately generate a CHANGELOG of your project. By doing the following simple command, Markdown for your CHANGELOG is displayed on stdout. @@ -430,8 +430,7 @@ Options to detect notes contained in commit bodies. ## Templates -The `git-chglog` template uses the `text/template` package. For basic usage please -refer to the following. +The `git-chglog` template uses the `text/template` package and enhanced templating functions provided by [Sprig](http://masterminds.github.io/sprig). For basic usage please refer to the following. > [text/template](https://golang.org/pkg/text/template/) @@ -607,7 +606,7 @@ Within a `Commit`, the following Jira data can be used in template: It is ideal to describe everything included in CHANGELOG in your commits. But actually it is very difficult to do it perfectly. - There are times when you need to edit the generated output to write a great CHANGELOG. + There are times when you need to edit the generated output to write a great CHANGELOG. By displaying it on the standard output, it makes it easy to change the contents. @@ -617,7 +616,7 @@ Within a `Commit`, the following Jira data can be used in template: Yes, it can be solved by using the `--next-tag` flag. - For example, let's say you want to upgrade your project to `2.0.0`. + For example, let's say you want to upgrade your project to `2.0.0`. You can create CHANGELOG containing `2.0.0` as follows. ```bash @@ -634,11 +633,11 @@ Within a `Commit`, the following Jira data can be used in template:
Can I generate a CHANGELOG based on certain tags? - + Yes, it can be solved by use the `--tag-filter-pattern` flag. - + For example, the following command will only include tags starting with "v": - + ```bash git-chglog --tag-filter-pattern '^v' ``` @@ -676,10 +675,10 @@ Bugs, feature requests and comments are more than welcome in the [issues]. ### Feedback -I would like to make `git-chglog` a better tool. +I would like to make `git-chglog` a better tool. The goal is to be able to use in various projects. -Therefore, your feedback is very useful. +Therefore, your feedback is very useful. I am very happy to tell you your opinions on Issues and PR :heart: ## CHANGELOG diff --git a/chglog.go b/chglog.go index 76a8fbec..541f577a 100644 --- a/chglog.go +++ b/chglog.go @@ -12,6 +12,7 @@ import ( "text/template" "time" + "github.com/Masterminds/sprig/v3" "github.com/tsuyoshiwada/go-gitcmd" ) @@ -324,18 +325,6 @@ func (gen *Generator) render(w io.Writer, unreleased *Unreleased, versions []*Ve "datetime": func(layout string, input time.Time) string { return input.Format(layout) }, - // check whether substr is within s - "contains": strings.Contains, - // check whether s begins with prefix - "hasPrefix": strings.HasPrefix, - // check whether s ends with suffix - "hasSuffix": strings.HasSuffix, - // replace the first n instances of old with new - "replace": strings.Replace, - // lower case a string - "lower": strings.ToLower, - // upper case a string - "upper": strings.ToUpper, // upper case the first character of a string "upperFirst": func(s string) string { if len(s) > 0 { @@ -355,7 +344,7 @@ func (gen *Generator) render(w io.Writer, unreleased *Unreleased, versions []*Ve fname := filepath.Base(gen.config.Template) - t := template.Must(template.New(fname).Funcs(fmap).ParseFiles(gen.config.Template)) + t := template.Must(template.New(fname).Funcs(sprig.TxtFuncMap()).Funcs(fmap).ParseFiles(gen.config.Template)) return t.Execute(w, &RenderData{ Info: gen.config.Info, diff --git a/chglog_test.go b/chglog_test.go index 969ee3b7..a00359bb 100644 --- a/chglog_test.go +++ b/chglog_test.go @@ -471,7 +471,7 @@ func TestGeneratorWithTagFiler(t *testing.T) { } -func TestGeneratorWithTimmedBody(t *testing.T) { +func TestGeneratorWithTrimmedBody(t *testing.T) { assert := assert.New(t) testName := "trimmed_body" @@ -549,3 +549,83 @@ When using .TrimmedBody Notes are not included and can only appear in the Notes [Unreleased]: https://github.com/git-chglog/git-chglog/compare/1.0.0...HEAD`, expected) } + +func TestGeneratorWithSprig(t *testing.T) { + assert := assert.New(t) + testName := "with_sprig" + + setup(testName, func(commit commitFunc, tag tagFunc, _ gitcmd.Client) { + commit("2018-01-01 00:00:00", "feat(core): version 1.0.0", "") + tag("1.0.0") + + commit("2018-02-01 00:00:00", "feat(core): version 2.0.0", "") + tag("2.0.0") + + commit("2018-03-01 00:00:00", "feat(core): version 3.0.0", "") + }) + + gen := NewGenerator(NewLogger(os.Stdout, os.Stderr, false, true), + &Config{ + Bin: "git", + WorkingDir: filepath.Join(testRepoRoot, testName), + Template: filepath.Join(cwd, "testdata", testName+".md"), + Info: &Info{ + Title: "CHANGELOG Example", + RepositoryURL: "https://github.com/git-chglog/git-chglog", + }, + Options: &Options{ + Sort: "date", + NextTag: "3.0.0", + CommitFilters: map[string][]string{ + "Type": { + "feat", + }, + }, + CommitSortBy: "Scope", + CommitGroupBy: "Type", + CommitGroupSortBy: "Title", + CommitGroupTitleMaps: map[string]string{ + "feat": "Features", + }, + HeaderPattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$", + HeaderPatternMaps: []string{ + "Type", + "Scope", + "Subject", + }, + }, + }) + + buf := &bytes.Buffer{} + err := gen.Generate(buf, "") + expected := strings.TrimSpace(buf.String()) + + assert.Nil(err) + assert.Equal(`My Changelog + +## [Unreleased] + + + +## [3.0.0] - 2018-03-01 +### Features +- **CORE:** version 3.0.0 + + + +## [2.0.0] - 2018-02-01 +### Features +- **CORE:** version 2.0.0 + + + +## 1.0.0 - 2018-01-01 +### Features +- **CORE:** version 1.0.0 + + +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/3.0.0...HEAD +[3.0.0]: https://github.com/git-chglog/git-chglog/compare/2.0.0...3.0.0 +[2.0.0]: https://github.com/git-chglog/git-chglog/compare/1.0.0...2.0.0`, expected) + +} diff --git a/go.mod b/go.mod index c56b0ef7..6eddc45c 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.16 require ( github.com/AlecAivazis/survey/v2 v2.2.9 + github.com/Masterminds/sprig/v3 v3.2.2 github.com/andygrunwald/go-jira v1.13.0 github.com/coreos/go-semver v0.3.0 github.com/fatih/color v1.10.0 diff --git a/go.sum b/go.sum index c6593849..aa19b196 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,12 @@ github.com/AlecAivazis/survey/v2 v2.2.9 h1:LWvJtUswz/W9/zVVXELrmlvdwWcKE60ZAw0FWV9vssk= github.com/AlecAivazis/survey/v2 v2.2.9/go.mod h1:9DYvHgXtiXm6nCn+jXnOXLKbH+Yo9u8fAS/SduGdoPk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= +github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8 h1:xzYJEypr/85nBpB11F9br+3HUrpgb+fcm5iADzXXYEw= github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc= github.com/andygrunwald/go-jira v1.13.0 h1:vvIImGgX32bHfoiyUwkNo+/YrPnRczNarvhLOncP6dE= @@ -22,8 +28,13 @@ github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 h1:zLTLjkaOFEFIOxY5BWLFLwh+cL8vOBW4XJ2aqLE/Tf0= github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174 h1:WlZsjVhE8Af9IcZDGgJGQpNflI3+MJSBhsgT5PCtzBQ= github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A= +github.com/huandu/xstrings v1.3.1 h1:4jgBlKK6tLKFvO8u5pmYjG91cqytmDCDvGh7ECVFfFs= +github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= @@ -40,16 +51,26 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= +github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/trivago/tgo v1.0.1 h1:bxatjJIXNIpV18bucU4Uk/LaoxvxuOlp/oowRHyncLQ= @@ -60,8 +81,9 @@ github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 h1:8dUaAV7K4uHsF56JQWkprecIQKdPHtR9jCHF5nB8uzc= golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904 h1:bXoxMPcSLOq08zI3/c5dEBT6lE4eh+jOh886GHrn6V8= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -74,6 +96,7 @@ golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= diff --git a/testdata/with_sprig.md b/testdata/with_sprig.md new file mode 100644 index 00000000..e4426012 --- /dev/null +++ b/testdata/with_sprig.md @@ -0,0 +1,57 @@ +{{ title "my changelog" }} +{{ if .Versions -}} + +## [Unreleased] + +{{ if .Unreleased.CommitGroups -}} +{{ range .Unreleased.CommitGroups -}} +### {{ .Title }} +{{ range .Commits -}} +- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} +{{ end }} +{{ end -}} +{{ end -}} +{{ end -}} + +{{ range .Versions }} + +## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }} +{{ range .CommitGroups -}} +### {{ .Title }} +{{ range .Commits -}} +- {{ if .Scope }}**{{ .Scope | upper }}:** {{ end }}{{ .Subject }} +{{ end }} +{{ end -}} + +{{- if .RevertCommits -}} +### Reverts +{{ range .RevertCommits -}} +- {{ .Revert.Header }} +{{ end }} +{{ end -}} + +{{- if .MergeCommits -}} +### Pull Requests +{{ range .MergeCommits -}} +- {{ .Header }} +{{ end }} +{{ end -}} + +{{- if .NoteGroups -}} +{{ range .NoteGroups -}} +### {{ .Title }} +{{ range .Notes }} +{{ .Body }} +{{ end }} +{{ end -}} +{{ end -}} +{{ end -}} + +{{- if .Versions }} +[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD +{{ range .Versions -}} +{{ if .Tag.Previous -}} +[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }} +{{ end -}} +{{ end -}} +{{ end -}} From 2f5b47b0f75f5258616b36fffcd2d33a16e3ddf7 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Sun, 28 Mar 2021 22:21:56 -0500 Subject: [PATCH 31/82] chore: update changelog for v0.14.0 --- CHANGELOG.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d01f571c..e8ea0194 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ ## [Unreleased] + +## [v0.14.0] - 2021-03-28 +### Chores +- **CHANGELOG:** regenerate CHANGELOG with type-scope and KAC template ([#129](https://github.com/git-chglog/git-chglog/issues/129)) + +### Features +- add sprig template functions support ([#131](https://github.com/git-chglog/git-chglog/issues/131)) +- add `--sort [TYPE]` flag ([#78](https://github.com/git-chglog/git-chglog/issues/78)) + + ## [v0.13.0] - 2021-03-23 ### Chores @@ -332,7 +342,8 @@ - First implement -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.13.0...HEAD +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.14.0...HEAD +[v0.14.0]: https://github.com/git-chglog/git-chglog/compare/v0.13.0...v0.14.0 [v0.13.0]: https://github.com/git-chglog/git-chglog/compare/v0.12.0...v0.13.0 [v0.12.0]: https://github.com/git-chglog/git-chglog/compare/v0.11.2...v0.12.0 [v0.11.2]: https://github.com/git-chglog/git-chglog/compare/v0.11.1...v0.11.2 From b02996e027acf22d15fb2e9acad5408f13e4dedc Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Tue, 30 Mar 2021 12:53:27 -0500 Subject: [PATCH 32/82] chore: add make release target (#130) Signed-off-by: Derek Smith --- Makefile | 7 +++++++ README.md | 22 +++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index cc5b6c0b..fdffdcb4 100644 --- a/Makefile +++ b/Makefile @@ -28,3 +28,10 @@ changelog: build .PHONY: lint lint: @golangci-lint run + +.PHONY: release +release: changelog + @git add CHANGELOG.md + @git commit -m "chore: update changelog for $(VERSION)" + git tag $(VERSION) + git push origin master $(VERSION) diff --git a/README.md b/README.md index fa6cab54..e4e56e31 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ [![godoc.org](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/git-chglog/git-chglog) [![Actions Status](https://github.com/git-chglog/git-chglog/workflows/tests/badge.svg)](https://github.com/git-chglog/git-chglog/actions) -[![AppVeyor](https://img.shields.io/appveyor/ci/tsuyoshiwada/git-chglog/master.svg?style=flat-square)](https://ci.appveyor.com/project/tsuyoshiwada/git-chglog/branch/master) [![Coverage Status](https://img.shields.io/coveralls/github/git-chglog/git-chglog.svg?style=flat-square)](https://coveralls.io/github/git-chglog/git-chglog?branch=master) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/git-chglog/git-chglog/blob/master/LICENSE) @@ -659,7 +658,7 @@ Within a `Commit`, the following Jira data can be used in template: We alway welcome your contributions :clap: -### Development +## Development 1. Use Golang version `>= 1.16` 1. Fork (https://github.com/git-chglog/git-chglog) :tada: @@ -673,7 +672,24 @@ We alway welcome your contributions :clap: Bugs, feature requests and comments are more than welcome in the [issues]. -### Feedback +## Release Process + +There is a `release` target within the Makefile that wraps up the steps to +release a new version. + +> NOTE: Pass the `VERSION` variable when running the command to properly set +> the tag version for the release. + +```bash +$ VERSION=vX.Y.Z make release +# EXAMPLE: +$ VERSION=v0.11.3 make release +``` + +Once the `tag` has been pushed, the `goreleaser` github action will take care +of the rest. + +## Feedback I would like to make `git-chglog` a better tool. The goal is to be able to use in various projects. From 8d9e00b6995828d6b170cf81996cd5d83ca92202 Mon Sep 17 00:00:00 2001 From: Khosrow Moossavi Date: Wed, 31 Mar 2021 12:41:24 -0400 Subject: [PATCH 33/82] ci: overall enhancements and cosmetics improvements (#134) * ci: cosmetic renaming CI jobs Signed-off-by: Khosrow Moossavi * chore: overrall Makefile enhancements Signed-off-by: Khosrow Moossavi --- .github/workflows/{test.yml => ci.yml} | 42 ++++++++--- .github/workflows/lint.yml | 18 ----- .github/workflows/release.yml | 12 ++- .goreleaser.yml | 6 +- Makefile | 100 +++++++++++++++++++------ 5 files changed, 122 insertions(+), 56 deletions(-) rename .github/workflows/{test.yml => ci.yml} (50%) delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/test.yml b/.github/workflows/ci.yml similarity index 50% rename from .github/workflows/test.yml rename to .github/workflows/ci.yml index 3327c1ab..c6be40f6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/ci.yml @@ -1,35 +1,57 @@ -name: tests +name: ci on: pull_request: - types: ['opened', 'synchronize'] + types: ["opened", "synchronize"] paths-ignore: - - 'README.md' + - "README.md" push: branches: - master paths-ignore: - - 'README.md' + - "README.md" + +env: + GO_VERSION: "1.16" + jobs: - unit: + tests: runs-on: ubuntu-20.04 + if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Checkout uses: actions/checkout@v2 with: fetch-depth: 0 + - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: ${{ env.GO_VERSION }} + - name: Run tests - run: | - make test + run: make test + - name: Install goveralls + run: go get github.com/mattn/goveralls env: GO111MODULE: off - run: go get github.com/mattn/goveralls + - name: Send coverage + run: goveralls -coverprofile=cover.out -service=github env: COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: goveralls -coverprofile=cover.out -service=github + + lint: + runs-on: ubuntu-20.04 + if: "!contains(github.event.head_commit.message, '[ci skip]')" + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + version: v1.38 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 49f5fde0..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: lint - -on: - pull_request: - types: ['opened', 'synchronize'] - push: - branches: - - master -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 - with: - version: v1.38 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2cc15f77..dab5ed9c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,22 +1,28 @@ -name: goreleaser +name: release on: push: tags: - - '*' + - "*" + +env: + GO_VERSION: "1.16" jobs: goreleaser: runs-on: ubuntu-20.04 + if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Checkout uses: actions/checkout@v2 with: fetch-depth: 0 + - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: ${{ env.GO_VERSION }} + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: diff --git a/.goreleaser.yml b/.goreleaser.yml index 0272d395..834eee6b 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -27,13 +27,13 @@ archives: format: zip checksum: - name_template: 'checksums.txt' + name_template: "checksums.txt" changelog: sort: desc filters: exclude: - - '^Merge' + - "^Merge" snapshot: name_template: "{{ .Tag }}-next" @@ -47,4 +47,4 @@ brews: test: | system "#{bin}/git-chglog --help" install: | - bin.install "git-chglog" \ No newline at end of file + bin.install "git-chglog" diff --git a/Makefile b/Makefile index fdffdcb4..e05c917c 100644 --- a/Makefile +++ b/Makefile @@ -1,37 +1,93 @@ -VERSION?=$$(git describe --tags --always) +# Build variables +VERSION ?= $(shell git describe --tags --always) -LDFLAGS="-X main.version=$(VERSION)" +# Go variables +GO ?= go +GOOS ?= $(shell $(GO) env GOOS) +GOARCH ?= $(shell $(GO) env GOARCH) +GOHOST ?= GOOS=$(GOOS) GOARCH=$(GOARCH) $(GO) + +LDFLAGS ?= "-X main.version=$(VERSION)" + +.PHONY: all +all: help + +############### +##@ Development .PHONY: clean -clean: +clean: ## Clean workspace + @ $(MAKE) --no-print-directory log-$@ rm -rf ./dist/ rm -rf ./git-chglog rm -rf $(GOPATH)/bin/git-chglog rm -rf cover.out -.PHONY: build -build: - go build -ldflags=$(LDFLAGS) -o git-chglog ./cmd/git-chglog - .PHONY: test -test: - go test -covermode atomic -coverprofile cover.out -v ./... - -.PHONY: install -install: - go install ./cmd/git-chglog - -.PHONY: changelog -changelog: build - ./git-chglog --next-tag $(VERSION) -o CHANGELOG.md +test: ## Run tests + @ $(MAKE) --no-print-directory log-$@ + $(GOHOST) test -covermode atomic -coverprofile cover.out -v ./... .PHONY: lint -lint: - @golangci-lint run +lint: ## Run linters + @ $(MAKE) --no-print-directory log-$@ + golangci-lint run + +######### +##@ Build + +.PHONY: build +build: ## Build git-chglog + @ $(MAKE) --no-print-directory log-$@ + CGO_ENABLED=0 $(GOHOST) build -ldflags=$(LDFLAGS) -o git-chglog ./cmd/git-chglog + +.PHONY: install +install: ## Install git-chglog + @ $(MAKE) --no-print-directory log-$@ + $(GOHOST) install ./cmd/git-chglog + +########### +##@ Release + +.PHONY: changelog +changelog: build ## Generate changelog + @ $(MAKE) --no-print-directory log-$@ + ./git-chglog --next-tag $(VERSION) -o CHANGELOG.md .PHONY: release -release: changelog - @git add CHANGELOG.md - @git commit -m "chore: update changelog for $(VERSION)" +release: changelog ## Release a new tag + @ $(MAKE) --no-print-directory log-$@ + git add CHANGELOG.md + git commit -m "chore: update changelog for $(VERSION)" git tag $(VERSION) git push origin master $(VERSION) + +######## +##@ Help + +.PHONY: help +help: ## Display this help + @awk \ + -v "col=\033[36m" -v "nocol=\033[0m" \ + ' \ + BEGIN { \ + FS = ":.*##" ; \ + printf "Usage:\n make %s%s\n", col, nocol \ + } \ + /^[a-zA-Z_-]+:.*?##/ { \ + printf " %s%-12s%s %s\n", col, $$1, nocol, $$2 \ + } \ + /^##@/ { \ + printf "\n%s%s%s\n", nocol, substr($$0, 5), nocol \ + } \ + ' $(MAKEFILE_LIST) + +log-%: + @grep -h -E '^$*:.*?## .*$$' $(MAKEFILE_LIST) | \ + awk \ + 'BEGIN { \ + FS = ":.*?## " \ + }; \ + { \ + printf "\033[36m==> %s\033[0m\n", $$2 \ + }' From 2307bff72f64d8712322e1c07a83207b371b8c46 Mon Sep 17 00:00:00 2001 From: Anthony MARQUES Date: Thu, 1 Apr 2021 17:41:35 +0200 Subject: [PATCH 34/82] feat: add docker image on release and master (#135) * feat: add docker image on release and master * resolves return on the PR * Add Installation docker doc * Update .github/workflows/publish.yml Co-authored-by: Derek Smith * Resovle PR conversations * No v in RawVersion Co-authored-by: Derek Smith --- .github/workflows/publish.yml | 35 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 9 ++++++++- .goreleaser.yml | 5 +++++ Dockerfile | 11 +++++++++++ README.md | 10 ++++++++++ 5 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml create mode 100644 Dockerfile diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..e0a641e8 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +name: publish + +on: + push: + branches: + - master + +env: + GO_VERSION: "1.16" + DOCKER_REGISTRY: "quay.io" + +jobs: + goreleaser: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} + - name: Build go binary + run: make build + - name: Login to GitHub Packages Docker Registry + uses: docker/login-action@v1 + with: + registry: ${{ env.DOCKER_REGISTRY }} + username: ${{ secrets.QUAY_IO_USER }} + password: ${{ secrets.QUAY_IO_TOKEN }} + - name: Build and Push docker image + run: | + docker build --pull --tag ${{ env.DOCKER_REGISTRY }}/git-chglog/git-chglog:edge . + docker push ${{ env.DOCKER_REGISTRY }}/git-chglog/git-chglog:edge diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dab5ed9c..1821bfdc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,7 @@ on: env: GO_VERSION: "1.16" + DOCKER_REGISTRY: "quay.io" jobs: goreleaser: @@ -22,7 +23,13 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ env.GO_VERSION }} - + - name: Login to GitHub Packages Docker Registry + uses: docker/login-action@v1 + with: + registry: ${{ env.DOCKER_REGISTRY }} + username: ${{ secrets.QUAY_IO_USER }} + password: ${{ secrets.QUAY_IO_TOKEN }} + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: diff --git a/.goreleaser.yml b/.goreleaser.yml index 834eee6b..b0d7d922 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -38,6 +38,11 @@ changelog: snapshot: name_template: "{{ .Tag }}-next" +dockers: + - image_templates: + - "quay.io/git-chglog/git-chglog:{{ .RawVersion }}" + - "quay.io/git-chglog/git-chglog:latest" + brews: - tap: owner: git-chglog diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..e0c24eb3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM alpine:3.13.3 + +RUN apk add --no-cache git && \ + mkdir /workdir + +COPY git-chglog /usr/local/bin/git-chglog + +WORKDIR /workdir +RUN chmod +x /usr/local/bin/git-chglog + +ENTRYPOINT [ "/usr/local/bin/git-chglog" ] \ No newline at end of file diff --git a/README.md b/README.md index e4e56e31..6e5146cd 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,16 @@ asdf install git-chglog latest go get -u github.com/git-chglog/git-chglog/cmd/git-chglog ``` +### [Docker](https://www.docker.com/) +The compiled docker images are maintained on [quay.io](https://quay.io/repository/git-chglog/git-chglog). +We maintain the following tags: +- `edge`: Image that is build from the current `HEAD` of the main line branch. +- `latest`: Image that is built from the [latest released version](https://github.com/git-chglog/git-chglog/releases) +- `x.y.y` (versions): Images that are build from the tagged versions within Github. +```bash +docker pull quay.io/git-chglog/git-chglog:latest +docker run -v "$PWD":/workdir quay.io/git-chglog/git-chglog --version +``` --- If you are using another platform, you can download a binary from the [releases page] From f76afed0869bcca179257da1cef4daffbaa1bd3f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 1 Apr 2021 10:47:18 -0500 Subject: [PATCH 35/82] chore(deps): update alpine docker tag to v3.13.4 (#136) Co-authored-by: Renovate Bot --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e0c24eb3..17e10731 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.13.3 +FROM alpine:3.13.4 RUN apk add --no-cache git && \ mkdir /workdir From 7cc56b12567c1fa193318e308395873e0ab6d70f Mon Sep 17 00:00:00 2001 From: Khosrow Moossavi Date: Fri, 2 Apr 2021 12:19:50 -0400 Subject: [PATCH 36/82] chore: add docker target to Makefile (#138) Signed-off-by: Khosrow Moossavi --- .github/workflows/ci.yml | 3 ++- .github/workflows/publish.yml | 16 ++++++++-------- .github/workflows/release.yml | 5 +++-- Makefile | 17 ++++++++++++++++- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6be40f6..1159a26b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,7 @@ on: env: GO_VERSION: "1.16" + GOLANGCI_VERSION: "v1.38" jobs: tests: @@ -54,4 +55,4 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: - version: v1.38 + version: ${{ env.GOLANGCI_VERSION }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e0a641e8..dbf077eb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,7 +2,7 @@ name: publish on: push: - branches: + branches: - master env: @@ -10,26 +10,26 @@ env: DOCKER_REGISTRY: "quay.io" jobs: - goreleaser: + docker: runs-on: ubuntu-20.04 + if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Checkout uses: actions/checkout@v2 with: fetch-depth: 0 + - name: Set up Go uses: actions/setup-go@v2 with: go-version: ${{ env.GO_VERSION }} - - name: Build go binary - run: make build - - name: Login to GitHub Packages Docker Registry + + - name: Login to Docker Registry uses: docker/login-action@v1 with: registry: ${{ env.DOCKER_REGISTRY }} username: ${{ secrets.QUAY_IO_USER }} password: ${{ secrets.QUAY_IO_TOKEN }} + - name: Build and Push docker image - run: | - docker build --pull --tag ${{ env.DOCKER_REGISTRY }}/git-chglog/git-chglog:edge . - docker push ${{ env.DOCKER_REGISTRY }}/git-chglog/git-chglog:edge + run: DOCKER_TAG=edge make docker push diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1821bfdc..6137d48d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,13 +23,14 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ env.GO_VERSION }} - - name: Login to GitHub Packages Docker Registry + + - name: Login to Docker Registry uses: docker/login-action@v1 with: registry: ${{ env.DOCKER_REGISTRY }} username: ${{ secrets.QUAY_IO_USER }} password: ${{ secrets.QUAY_IO_TOKEN }} - + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: diff --git a/Makefile b/Makefile index e05c917c..8c09f6fd 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,11 @@ GOHOST ?= GOOS=$(GOOS) GOARCH=$(GOARCH) $(GO) LDFLAGS ?= "-X main.version=$(VERSION)" +# Docker variables +DEFAULT_TAG ?= $(shell echo "$(VERSION)" | tr -d 'v') +DOCKER_IMAGE := quay.io/git-chglog/git-chglog +DOCKER_TAG ?= $(DEFAULT_TAG) + .PHONY: all all: help @@ -46,6 +51,16 @@ install: ## Install git-chglog @ $(MAKE) --no-print-directory log-$@ $(GOHOST) install ./cmd/git-chglog +.PHONY: docker +docker: build ## Build Docker image + @ $(MAKE) --no-print-directory log-$@ + docker build --pull --tag $(DOCKER_IMAGE):$(DOCKER_TAG) . + +.PHONY: push +push: ## Push Docker image + @ $(MAKE) --no-print-directory log-$@ + docker push $(DOCKER_IMAGE):$(DOCKER_TAG) + ########### ##@ Release @@ -55,7 +70,7 @@ changelog: build ## Generate changelog ./git-chglog --next-tag $(VERSION) -o CHANGELOG.md .PHONY: release -release: changelog ## Release a new tag +release: changelog ## Release a new tag @ $(MAKE) --no-print-directory log-$@ git add CHANGELOG.md git commit -m "chore: update changelog for $(VERSION)" From fdd421b057404b7a1d2c9c6493c8075322b19725 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Tue, 13 Apr 2021 16:27:42 -0500 Subject: [PATCH 37/82] fix(template): address regression in string functions for template engine (#142) It appears that `Sprig` flips the inputs of the `contains`, `hasPrefix`, `replace` and `hasSuffix` `strings` methods. This appears to be the cause of the regression. See: https://github.com/Masterminds/sprig/blob/master/functions.go#L149-L152 This results in a regression against the previous implementations of the template functions. Signed-off-by: Derek Smith --- README.md | 18 ++++++++++++++++-- chglog.go | 7 +++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6e5146cd..be6c636f 100644 --- a/README.md +++ b/README.md @@ -439,9 +439,22 @@ Options to detect notes contained in commit bodies. ## Templates -The `git-chglog` template uses the `text/template` package and enhanced templating functions provided by [Sprig](http://masterminds.github.io/sprig). For basic usage please refer to the following. +The `git-chglog` template uses the `text/template` package and enhanced templating functions provided by [Sprig]. For basic usage please refer to the following. -> [text/template](https://golang.org/pkg/text/template/) +- [text/template](https://golang.org/pkg/text/template/) +- [Sprig] + +We have implemented the following custom template functions. These override functions provided by [Sprig]. + +| Name | Signature | Description | +| :----------- | :-------------------------------------------- | :---------------------------------------------------------------------------- | +| `contains` | `func(s, substr string) bool` | Reports whether `substr` is within `s` using `strings.Contains` | +| `datetime` | `func(layout string, input time.Time) string` | Generate a formatted Date string based on layout | +| `hasPrefix` | `func(s, prefix string) bool` | Tests whether the string `s` begins with `prefix` using `strings.HasPrefix` | +| `hasSuffix` | `func(s, suffix string) bool` | Tests whether the string `s` ends with `suffix`. using `strings.HasPrefix` | +| `indent` | `func(s string, n int) string` | Indent all lines of `s` by `n` spaces | +| `replace` | `func(s, old, new string, n int) string` | Replace `old` with `new` within string `s`, `n` times using `strings.Replace` | +| `upperFirst` | `func(s string) string` | Upper case the first character of a string | If you are not satisfied with the prepared template please try customizing one. @@ -729,3 +742,4 @@ See [CHANGELOG.md](./CHANGELOG.md) [golangci-lint]: https://golangci-lint.run/usage/install/#local-installation [issues]: https://github.com/git-chglog/git-chglog/issues [git-chglog/artwork]: https://github.com/git-chglog/artwork +[Sprig]: http://masterminds.github.io/sprig diff --git a/chglog.go b/chglog.go index 541f577a..1a084c8a 100644 --- a/chglog.go +++ b/chglog.go @@ -340,6 +340,13 @@ func (gen *Generator) render(w io.Writer, unreleased *Unreleased, versions []*Ve pad := strings.Repeat(" ", n) return pad + strings.ReplaceAll(s, "\n", "\n"+pad) }, + // While Sprig provides these functions, they change the standard input + // order which leads to a regression. For an example see: + // https://github.com/Masterminds/sprig/blob/master/functions.go#L149 + "contains": strings.Contains, + "hasPrefix": strings.HasPrefix, + "hasSuffix": strings.HasSuffix, + "replace": strings.Replace, } fname := filepath.Base(gen.config.Template) From bc0f3633279470f093cb7fa25dcb6b0d66e52391 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Tue, 13 Apr 2021 16:35:35 -0500 Subject: [PATCH 38/82] chore: update changelog for v0.14.1 --- CHANGELOG.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8ea0194..d3f51baf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,24 @@ ## [Unreleased] + +## [v0.14.1] - 2021-04-13 +### Bug Fixes +- **template:** address regression in string functions for template engine ([#142](https://github.com/git-chglog/git-chglog/issues/142)) + +### Chores +- add docker target to Makefile ([#138](https://github.com/git-chglog/git-chglog/issues/138)) +- add make release target ([#130](https://github.com/git-chglog/git-chglog/issues/130)) +- **deps:** update alpine docker tag to v3.13.4 ([#136](https://github.com/git-chglog/git-chglog/issues/136)) + +### Features +- add docker image on release and master ([#135](https://github.com/git-chglog/git-chglog/issues/135)) + + ## [v0.14.0] - 2021-03-28 ### Chores +- update changelog for v0.14.0 - **CHANGELOG:** regenerate CHANGELOG with type-scope and KAC template ([#129](https://github.com/git-chglog/git-chglog/issues/129)) ### Features @@ -342,7 +357,8 @@ - First implement -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.14.0...HEAD +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.14.1...HEAD +[v0.14.1]: https://github.com/git-chglog/git-chglog/compare/v0.14.0...v0.14.1 [v0.14.0]: https://github.com/git-chglog/git-chglog/compare/v0.13.0...v0.14.0 [v0.13.0]: https://github.com/git-chglog/git-chglog/compare/v0.12.0...v0.13.0 [v0.12.0]: https://github.com/git-chglog/git-chglog/compare/v0.11.2...v0.12.0 From 57aad771c8984f019be08d8545a208684fb11461 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 14 Apr 2021 15:46:29 -0400 Subject: [PATCH 39/82] chore(deps): update alpine docker tag to v3.13.5 (#144) Co-authored-by: Renovate Bot --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 17e10731..53d290cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.13.4 +FROM alpine:3.13.5 RUN apk add --no-cache git && \ mkdir /workdir From bfac4702a715c2bb457f11bcaa1166c626eeef69 Mon Sep 17 00:00:00 2001 From: Khosrow Moossavi Date: Wed, 14 Apr 2021 17:01:05 -0400 Subject: [PATCH 40/82] fix: add CommitGroupTitleOrder back to Options (#143) This was, accidentally, removed in part of one PR a while back and caused the Custom sort to not work properly. Signed-off-by: Khosrow Moossavi --- cmd/git-chglog/config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/git-chglog/config.go b/cmd/git-chglog/config.go index 98e22fbd..abfe82e8 100644 --- a/cmd/git-chglog/config.go +++ b/cmd/git-chglog/config.go @@ -316,6 +316,7 @@ func (config *Config) Convert(ctx *CLIContext) *chglog.Config { CommitGroupBy: opts.CommitGroups.GroupBy, CommitGroupSortBy: opts.CommitGroups.SortBy, CommitGroupTitleMaps: opts.CommitGroups.TitleMaps, + CommitGroupTitleOrder: opts.CommitGroups.TitleOrder, HeaderPattern: opts.Header.Pattern, HeaderPatternMaps: opts.Header.PatternMaps, IssuePrefix: opts.Issues.Prefix, From c257740de96dc4c79988e4301604fda46262e836 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Fri, 16 Apr 2021 07:17:02 -0500 Subject: [PATCH 41/82] chore: update changelog for v0.14.2 --- CHANGELOG.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3f51baf..9db1d249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,22 @@ ## [Unreleased] + +## [v0.14.2] - 2021-04-14 +### Bug Fixes +- add CommitGroupTitleOrder back to Options ([#143](https://github.com/git-chglog/git-chglog/issues/143)) + +### Chores +- **deps:** update alpine docker tag to v3.13.5 ([#144](https://github.com/git-chglog/git-chglog/issues/144)) + + ## [v0.14.1] - 2021-04-13 ### Bug Fixes - **template:** address regression in string functions for template engine ([#142](https://github.com/git-chglog/git-chglog/issues/142)) ### Chores +- update changelog for v0.14.1 - add docker target to Makefile ([#138](https://github.com/git-chglog/git-chglog/issues/138)) - add make release target ([#130](https://github.com/git-chglog/git-chglog/issues/130)) - **deps:** update alpine docker tag to v3.13.4 ([#136](https://github.com/git-chglog/git-chglog/issues/136)) @@ -357,7 +367,8 @@ - First implement -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.14.1...HEAD +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.14.2...HEAD +[v0.14.2]: https://github.com/git-chglog/git-chglog/compare/v0.14.1...v0.14.2 [v0.14.1]: https://github.com/git-chglog/git-chglog/compare/v0.14.0...v0.14.1 [v0.14.0]: https://github.com/git-chglog/git-chglog/compare/v0.13.0...v0.14.0 [v0.13.0]: https://github.com/git-chglog/git-chglog/compare/v0.12.0...v0.13.0 From cefdc53e2908005521dc3cb6b14961dccfa75dec Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 30 Apr 2021 14:03:34 +0200 Subject: [PATCH 42/82] fix(deps): update module github.com/alecaivazis/survey/v2 to v2.2.12 (#147) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 6eddc45c..68f78d7e 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/git-chglog/git-chglog go 1.16 require ( - github.com/AlecAivazis/survey/v2 v2.2.9 + github.com/AlecAivazis/survey/v2 v2.2.12 github.com/Masterminds/sprig/v3 v3.2.2 github.com/andygrunwald/go-jira v1.13.0 github.com/coreos/go-semver v0.3.0 diff --git a/go.sum b/go.sum index aa19b196..fc363ed7 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/AlecAivazis/survey/v2 v2.2.9 h1:LWvJtUswz/W9/zVVXELrmlvdwWcKE60ZAw0FWV9vssk= -github.com/AlecAivazis/survey/v2 v2.2.9/go.mod h1:9DYvHgXtiXm6nCn+jXnOXLKbH+Yo9u8fAS/SduGdoPk= +github.com/AlecAivazis/survey/v2 v2.2.12 h1:5a07y93zA6SZ09gOa9wLVLznF5zTJMQ+pJ3cZK4IuO8= +github.com/AlecAivazis/survey/v2 v2.2.12/go.mod h1:6d4saEvBsfSHXeN1a5OA5m2+HJ2LuVokllnC77pAIKI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= @@ -92,8 +92,10 @@ golang.org/x/sys v0.0.0-20190530182044-ad28b68e88f1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From ac01b30c393908d7a42ca0272af69d5e8f615ad6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 May 2021 09:19:18 +0200 Subject: [PATCH 43/82] fix(deps): update module github.com/fatih/color to v1.11.0 (#149) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 68f78d7e..8ff62ca7 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/Masterminds/sprig/v3 v3.2.2 github.com/andygrunwald/go-jira v1.13.0 github.com/coreos/go-semver v0.3.0 - github.com/fatih/color v1.10.0 + github.com/fatih/color v1.11.0 github.com/imdario/mergo v0.3.12 github.com/kyokomi/emoji/v2 v2.2.8 github.com/mattn/go-colorable v0.1.8 diff --git a/go.sum b/go.sum index fc363ed7..7e4d4f9b 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= -github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/color v1.11.0 h1:l4iX0RqNnx/pU7rY2DB/I+znuYY0K3x6Ywac6EIr0PA= +github.com/fatih/color v1.11.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/structs v1.0.0 h1:BrX964Rv5uQ3wwS+KRUAJCBBw5PQmgJfJ6v4yly5QwU= github.com/fatih/structs v1.0.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= From 9842899ea1cb3ca08b41c3087bad667753f2314c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 25 May 2021 09:05:09 +0200 Subject: [PATCH 44/82] fix(deps): update module github.com/fatih/color to v1.12.0 (#150) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8ff62ca7..81720284 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/Masterminds/sprig/v3 v3.2.2 github.com/andygrunwald/go-jira v1.13.0 github.com/coreos/go-semver v0.3.0 - github.com/fatih/color v1.11.0 + github.com/fatih/color v1.12.0 github.com/imdario/mergo v0.3.12 github.com/kyokomi/emoji/v2 v2.2.8 github.com/mattn/go-colorable v0.1.8 diff --git a/go.sum b/go.sum index 7e4d4f9b..e3a6b40b 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/fatih/color v1.11.0 h1:l4iX0RqNnx/pU7rY2DB/I+znuYY0K3x6Ywac6EIr0PA= -github.com/fatih/color v1.11.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc= +github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/structs v1.0.0 h1:BrX964Rv5uQ3wwS+KRUAJCBBw5PQmgJfJ6v4yly5QwU= github.com/fatih/structs v1.0.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= From b38b5032cffdc80e1f4c3de8a6b13e924fe058aa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 17 Jun 2021 07:05:15 -0500 Subject: [PATCH 45/82] chore(deps): update alpine docker tag to v3.14.0 (#153) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 53d290cb..2ee46d63 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.13.5 +FROM alpine:3.14.0 RUN apk add --no-cache git && \ mkdir /workdir From 6a18b6ef90c104805e77d1b2876b1b52d552d069 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 29 Jun 2021 08:24:33 +0200 Subject: [PATCH 46/82] fix(deps): update module github.com/alecaivazis/survey/v2 to v2.2.13 (#156) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 81720284..23c190d3 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/git-chglog/git-chglog go 1.16 require ( - github.com/AlecAivazis/survey/v2 v2.2.12 + github.com/AlecAivazis/survey/v2 v2.2.13 github.com/Masterminds/sprig/v3 v3.2.2 github.com/andygrunwald/go-jira v1.13.0 github.com/coreos/go-semver v0.3.0 diff --git a/go.sum b/go.sum index e3a6b40b..3a1a9c6b 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/AlecAivazis/survey/v2 v2.2.12 h1:5a07y93zA6SZ09gOa9wLVLznF5zTJMQ+pJ3cZK4IuO8= -github.com/AlecAivazis/survey/v2 v2.2.12/go.mod h1:6d4saEvBsfSHXeN1a5OA5m2+HJ2LuVokllnC77pAIKI= +github.com/AlecAivazis/survey/v2 v2.2.13 h1:7s6Msv/M4omLvZ0PfItdmr/VqPEgsLLuxj5NvREsQu8= +github.com/AlecAivazis/survey/v2 v2.2.13/go.mod h1:TH2kPCDU3Kqq7pLbnCWwZXDBjnhZtmsCle5EiYDJ2fg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= @@ -88,10 +88,12 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190530182044-ad28b68e88f1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w= +golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= From 45e01f0f7f6a50a5129d5eb84bb5a30806ddb3d9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 5 Jul 2021 10:18:56 +0200 Subject: [PATCH 47/82] fix(deps): update module github.com/alecaivazis/survey/v2 to v2.2.14 (#158) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 23c190d3..475f4977 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/git-chglog/git-chglog go 1.16 require ( - github.com/AlecAivazis/survey/v2 v2.2.13 + github.com/AlecAivazis/survey/v2 v2.2.14 github.com/Masterminds/sprig/v3 v3.2.2 github.com/andygrunwald/go-jira v1.13.0 github.com/coreos/go-semver v0.3.0 diff --git a/go.sum b/go.sum index 3a1a9c6b..2bcbaf65 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/AlecAivazis/survey/v2 v2.2.13 h1:7s6Msv/M4omLvZ0PfItdmr/VqPEgsLLuxj5NvREsQu8= -github.com/AlecAivazis/survey/v2 v2.2.13/go.mod h1:TH2kPCDU3Kqq7pLbnCWwZXDBjnhZtmsCle5EiYDJ2fg= +github.com/AlecAivazis/survey/v2 v2.2.14 h1:aTYTaCh1KLd+YWilkeJ65Ph78g48NVQ3ay9xmaNIyhk= +github.com/AlecAivazis/survey/v2 v2.2.14/go.mod h1:TH2kPCDU3Kqq7pLbnCWwZXDBjnhZtmsCle5EiYDJ2fg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= From 21b98bd56f012c0fba882c0950c41af5ce5e4506 Mon Sep 17 00:00:00 2001 From: "Thierno IB. BARRY" Date: Fri, 9 Jul 2021 09:26:33 +0200 Subject: [PATCH 48/82] feat: Automatic link for gitlab merge requests (#160) --- processor.go | 16 +++++++++++----- processor_test.go | 20 ++++++++++++-------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/processor.go b/processor.go index 505fec6c..06580408 100644 --- a/processor.go +++ b/processor.go @@ -70,12 +70,14 @@ func (p *GitHubProcessor) addLinks(input string) string { // // The following processing is performed // - Mentions automatic link (@tsuyoshiwada -> [@tsuyoshiwada](https://gitlab.com/tsuyoshiwada)) -// - Automatic link to references (#123 -> [#123](https://gitlab.com/owner/repo/issues/123)) +// - Automatic link to references issues (#123 -> [#123](https://gitlab.com/owner/repo/issues/123)) +// - Automatic link to references merge request (!123 -> [#123](https://gitlab.com/owner/repo/merge_requests/123)) type GitLabProcessor struct { - Host string // Host name used for link destination. Note: You must include the protocol (e.g. "https://gitlab.com") - config *Config - reMention *regexp.Regexp - reIssue *regexp.Regexp + Host string // Host name used for link destination. Note: You must include the protocol (e.g. "https://gitlab.com") + config *Config + reMention *regexp.Regexp + reIssue *regexp.Regexp + reMergeRequest *regexp.Regexp } // Bootstrap ... @@ -90,6 +92,7 @@ func (p *GitLabProcessor) Bootstrap(config *Config) { p.reMention = regexp.MustCompile(`@(\w+)`) p.reIssue = regexp.MustCompile(`(?i)#(\d+)`) + p.reMergeRequest = regexp.MustCompile(`(?i)!(\d+)`) } // ProcessCommit ... @@ -118,6 +121,9 @@ func (p *GitLabProcessor) addLinks(input string) string { // issues input = p.reIssue.ReplaceAllString(input, "[#$1]("+repoURL+"/issues/$1)") + // merge requests + input = p.reMergeRequest.ReplaceAllString(input, "[!$1]("+repoURL+"/merge_requests/$1)") + return input } diff --git a/processor_test.go b/processor_test.go index 88e8502e..1b15bd3f 100644 --- a/processor_test.go +++ b/processor_test.go @@ -83,30 +83,34 @@ func TestGitLabProcessor(t *testing.T) { assert.Equal( &Commit{ - Header: "message [@foo](https://gitlab.com/foo) [#123](https://example.com/issues/123)", - Subject: "message [@foo](https://gitlab.com/foo) [#123](https://example.com/issues/123)", + Header: "message [@foo](https://gitlab.com/foo) [#123](https://example.com/issues/123) [!345](https://example.com/merge_requests/345)", + Subject: "message [@foo](https://gitlab.com/foo) [#123](https://example.com/issues/123) [!345](https://example.com/merge_requests/345)", Body: `issue [#456](https://example.com/issues/456) multiline [#789](https://example.com/issues/789) +merge request [!345](https://example.com/merge_requests/345) [@foo](https://gitlab.com/foo), [@bar](https://gitlab.com/bar)`, Notes: []*Note{ { - Body: `issue1 [#11](https://example.com/issues/11) + Body: `issue1 [#11](https://example.com/issues/11) [!33](https://example.com/merge_requests/33) issue2 [#22](https://example.com/issues/22) +merge request [!33](https://example.com/merge_requests/33) gh-56 hoge fuga`, }, }, }, processor.ProcessCommit( &Commit{ - Header: "message @foo #123", - Subject: "message @foo #123", + Header: "message @foo #123 !345", + Subject: "message @foo #123 !345", Body: `issue #456 multiline #789 +merge request !345 @foo, @bar`, Notes: []*Note{ { - Body: `issue1 #11 + Body: `issue1 #11 !33 issue2 #22 +merge request !33 gh-56 hoge fuga`, }, }, @@ -117,13 +121,13 @@ gh-56 hoge fuga`, assert.Equal( &Commit{ Revert: &Revert{ - Header: "revert header [@mention](https://gitlab.com/mention) [#123](https://example.com/issues/123)", + Header: "revert header [@mention](https://gitlab.com/mention) [#123](https://example.com/issues/123) [!345](https://example.com/merge_requests/345)", }, }, processor.ProcessCommit( &Commit{ Revert: &Revert{ - Header: "revert header @mention #123", + Header: "revert header @mention #123 !345", }, }, ), From 82ead28bee086db43cb5e228ae6b33a6f9595723 Mon Sep 17 00:00:00 2001 From: Manuel Vogel Date: Fri, 9 Jul 2021 09:31:50 +0200 Subject: [PATCH 49/82] chore: update changelog for v0.15.0 --- CHANGELOG.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9db1d249..cff4c0df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,29 @@ ## [Unreleased] + +## [v0.15.0] - 2021-07-09 +### Bug Fixes +- **deps:** update module github.com/alecaivazis/survey/v2 to v2.2.14 ([#158](https://github.com/git-chglog/git-chglog/issues/158)) +- **deps:** update module github.com/alecaivazis/survey/v2 to v2.2.13 ([#156](https://github.com/git-chglog/git-chglog/issues/156)) +- **deps:** update module github.com/fatih/color to v1.12.0 ([#150](https://github.com/git-chglog/git-chglog/issues/150)) +- **deps:** update module github.com/fatih/color to v1.11.0 ([#149](https://github.com/git-chglog/git-chglog/issues/149)) +- **deps:** update module github.com/alecaivazis/survey/v2 to v2.2.12 ([#147](https://github.com/git-chglog/git-chglog/issues/147)) + +### Chores +- **deps:** update alpine docker tag to v3.14.0 ([#153](https://github.com/git-chglog/git-chglog/issues/153)) + +### Features +- Automatic link for gitlab merge requests ([#160](https://github.com/git-chglog/git-chglog/issues/160)) + + -## [v0.14.2] - 2021-04-14 +## [v0.14.2] - 2021-04-16 ### Bug Fixes - add CommitGroupTitleOrder back to Options ([#143](https://github.com/git-chglog/git-chglog/issues/143)) ### Chores +- update changelog for v0.14.2 - **deps:** update alpine docker tag to v3.13.5 ([#144](https://github.com/git-chglog/git-chglog/issues/144)) @@ -367,7 +384,8 @@ - First implement -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.14.2...HEAD +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.15.0...HEAD +[v0.15.0]: https://github.com/git-chglog/git-chglog/compare/v0.14.2...v0.15.0 [v0.14.2]: https://github.com/git-chglog/git-chglog/compare/v0.14.1...v0.14.2 [v0.14.1]: https://github.com/git-chglog/git-chglog/compare/v0.14.0...v0.14.1 [v0.14.0]: https://github.com/git-chglog/git-chglog/compare/v0.13.0...v0.14.0 From 0022ecf864d223d593a1c6e737b166b2d5012c6c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Jul 2021 10:13:47 +0200 Subject: [PATCH 50/82] fix(deps): update module github.com/alecaivazis/survey/v2 to v2.2.15 (#163) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 475f4977..dc6ad6e6 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/git-chglog/git-chglog go 1.16 require ( - github.com/AlecAivazis/survey/v2 v2.2.14 + github.com/AlecAivazis/survey/v2 v2.2.15 github.com/Masterminds/sprig/v3 v3.2.2 github.com/andygrunwald/go-jira v1.13.0 github.com/coreos/go-semver v0.3.0 diff --git a/go.sum b/go.sum index 2bcbaf65..dceb75d1 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/AlecAivazis/survey/v2 v2.2.14 h1:aTYTaCh1KLd+YWilkeJ65Ph78g48NVQ3ay9xmaNIyhk= -github.com/AlecAivazis/survey/v2 v2.2.14/go.mod h1:TH2kPCDU3Kqq7pLbnCWwZXDBjnhZtmsCle5EiYDJ2fg= +github.com/AlecAivazis/survey/v2 v2.2.15 h1:6UNMnk+YGegYFiPfdTOyZDIN+m08x2nGnqOn15BWcEQ= +github.com/AlecAivazis/survey/v2 v2.2.15/go.mod h1:TH2kPCDU3Kqq7pLbnCWwZXDBjnhZtmsCle5EiYDJ2fg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= From 7a3896821bd7d6bb51767b13ee40b2fb29bcb633 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 Aug 2021 11:34:53 +0200 Subject: [PATCH 51/82] fix(deps): update module github.com/alecaivazis/survey/v2 to v2.2.16 (#165) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index dc6ad6e6..1acfc6fe 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/git-chglog/git-chglog go 1.16 require ( - github.com/AlecAivazis/survey/v2 v2.2.15 + github.com/AlecAivazis/survey/v2 v2.2.16 github.com/Masterminds/sprig/v3 v3.2.2 github.com/andygrunwald/go-jira v1.13.0 github.com/coreos/go-semver v0.3.0 diff --git a/go.sum b/go.sum index dceb75d1..79f05f66 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/AlecAivazis/survey/v2 v2.2.15 h1:6UNMnk+YGegYFiPfdTOyZDIN+m08x2nGnqOn15BWcEQ= -github.com/AlecAivazis/survey/v2 v2.2.15/go.mod h1:TH2kPCDU3Kqq7pLbnCWwZXDBjnhZtmsCle5EiYDJ2fg= +github.com/AlecAivazis/survey/v2 v2.2.16 h1:KJ4fLFqY/NfR5OaFLcf4pThxrlV2YCHGCnCHAKLsJ+U= +github.com/AlecAivazis/survey/v2 v2.2.16/go.mod h1:TH2kPCDU3Kqq7pLbnCWwZXDBjnhZtmsCle5EiYDJ2fg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= From 93707ab6672963a3c96619f2a18b5727e7b60116 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 Aug 2021 15:56:31 +0200 Subject: [PATCH 52/82] fix(deps): update module github.com/andygrunwald/go-jira to v1.14.0 (#167) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 1acfc6fe..6ec880d2 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/AlecAivazis/survey/v2 v2.2.16 github.com/Masterminds/sprig/v3 v3.2.2 - github.com/andygrunwald/go-jira v1.13.0 + github.com/andygrunwald/go-jira v1.14.0 github.com/coreos/go-semver v0.3.0 github.com/fatih/color v1.12.0 github.com/imdario/mergo v0.3.12 diff --git a/go.sum b/go.sum index 79f05f66..6c4c63f2 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,8 @@ github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmy github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8 h1:xzYJEypr/85nBpB11F9br+3HUrpgb+fcm5iADzXXYEw= github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc= -github.com/andygrunwald/go-jira v1.13.0 h1:vvIImGgX32bHfoiyUwkNo+/YrPnRczNarvhLOncP6dE= -github.com/andygrunwald/go-jira v1.13.0/go.mod h1:jYi4kFDbRPZTJdJOVJO4mpMMIwdB+rcZwSO58DzPd2I= +github.com/andygrunwald/go-jira v1.14.0 h1:7GT/3qhar2dGJ0kq8w0d63liNyHOnxZsUZ9Pe4+AKBI= +github.com/andygrunwald/go-jira v1.14.0/go.mod h1:KMo2f4DgMZA1C9FdImuLc04x4WQhn5derQpnsuBFgqE= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= @@ -18,14 +18,14 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc= github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/fatih/structs v1.0.0 h1:BrX964Rv5uQ3wwS+KRUAJCBBw5PQmgJfJ6v4yly5QwU= -github.com/fatih/structs v1.0.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 h1:zLTLjkaOFEFIOxY5BWLFLwh+cL8vOBW4XJ2aqLE/Tf0= github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= @@ -55,8 +55,8 @@ github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMK github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= @@ -73,14 +73,13 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/trivago/tgo v1.0.1 h1:bxatjJIXNIpV18bucU4Uk/LaoxvxuOlp/oowRHyncLQ= -github.com/trivago/tgo v1.0.1/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkFnhc= +github.com/trivago/tgo v1.0.7 h1:uaWH/XIy9aWYWpjm2CU3RpcqZXmX2ysQ9/Go+d9gyrM= +github.com/trivago/tgo v1.0.7/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkFnhc= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df h1:Y2l28Jr3vOEeYtxfVbMtVfOdAwuUqWaP9fvNKiBVeXY= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df/go.mod h1:pnyouUty/nBr/zm3GYwTIt+qFTLWbdjeLjZmJdzJOu8= github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904 h1:bXoxMPcSLOq08zI3/c5dEBT6lE4eh+jOh886GHrn6V8= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -92,12 +91,14 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 899c1ede45f567a0b0296c2233c150797cfb07f9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 31 Aug 2021 12:24:56 +0200 Subject: [PATCH 53/82] chore(deps): update all non-major dependencies docker tags (#168) Co-authored-by: Renovate Bot --- Dockerfile | 2 +- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2ee46d63..6dcc2972 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.14.0 +FROM alpine:3.14.2 RUN apk add --no-cache git && \ mkdir /workdir diff --git a/go.mod b/go.mod index 6ec880d2..a42e11e9 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/git-chglog/git-chglog go 1.16 require ( - github.com/AlecAivazis/survey/v2 v2.2.16 + github.com/AlecAivazis/survey/v2 v2.3.1 github.com/Masterminds/sprig/v3 v3.2.2 github.com/andygrunwald/go-jira v1.14.0 github.com/coreos/go-semver v0.3.0 diff --git a/go.sum b/go.sum index 6c4c63f2..72740ee5 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/AlecAivazis/survey/v2 v2.2.16 h1:KJ4fLFqY/NfR5OaFLcf4pThxrlV2YCHGCnCHAKLsJ+U= -github.com/AlecAivazis/survey/v2 v2.2.16/go.mod h1:TH2kPCDU3Kqq7pLbnCWwZXDBjnhZtmsCle5EiYDJ2fg= +github.com/AlecAivazis/survey/v2 v2.3.1 h1:lzkuHA60pER7L4eYL8qQJor4bUWlJe4V0gqAT19tdOA= +github.com/AlecAivazis/survey/v2 v2.3.1/go.mod h1:TH2kPCDU3Kqq7pLbnCWwZXDBjnhZtmsCle5EiYDJ2fg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= From 2861505ecb7003074bbfa11ed2d2b86df9f82a00 Mon Sep 17 00:00:00 2001 From: Jameson Stone Date: Tue, 14 Dec 2021 07:20:18 -0500 Subject: [PATCH 54/82] ci(workflows): :wrench: remove manual if contains skip in workflows (#164) --- .github/workflows/ci.yml | 2 -- .github/workflows/publish.yml | 1 - .github/workflows/release.yml | 1 - 3 files changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1159a26b..139168a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,6 @@ env: jobs: tests: runs-on: ubuntu-20.04 - if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Checkout uses: actions/checkout@v2 @@ -45,7 +44,6 @@ jobs: lint: runs-on: ubuntu-20.04 - if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index dbf077eb..5b52a901 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,7 +12,6 @@ env: jobs: docker: runs-on: ubuntu-20.04 - if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6137d48d..812a8488 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,6 @@ env: jobs: goreleaser: runs-on: ubuntu-20.04 - if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Checkout uses: actions/checkout@v2 From 3d8006051f1c953d3d7208854e6513ef5e0fac14 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Dec 2021 13:20:53 +0100 Subject: [PATCH 55/82] fix(deps): update all non-major dependencies (#179) Co-authored-by: Renovate Bot --- go.mod | 6 +++--- go.sum | 20 ++++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index a42e11e9..fe01f655 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,14 @@ module github.com/git-chglog/git-chglog go 1.16 require ( - github.com/AlecAivazis/survey/v2 v2.3.1 + github.com/AlecAivazis/survey/v2 v2.3.2 github.com/Masterminds/sprig/v3 v3.2.2 github.com/andygrunwald/go-jira v1.14.0 github.com/coreos/go-semver v0.3.0 - github.com/fatih/color v1.12.0 + github.com/fatih/color v1.13.0 github.com/imdario/mergo v0.3.12 github.com/kyokomi/emoji/v2 v2.2.8 - github.com/mattn/go-colorable v0.1.8 + github.com/mattn/go-colorable v0.1.11 github.com/stretchr/testify v1.7.0 github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df github.com/urfave/cli/v2 v2.3.0 diff --git a/go.sum b/go.sum index 72740ee5..9e37ce7f 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/AlecAivazis/survey/v2 v2.3.1 h1:lzkuHA60pER7L4eYL8qQJor4bUWlJe4V0gqAT19tdOA= -github.com/AlecAivazis/survey/v2 v2.3.1/go.mod h1:TH2kPCDU3Kqq7pLbnCWwZXDBjnhZtmsCle5EiYDJ2fg= +github.com/AlecAivazis/survey/v2 v2.3.2 h1:TqTB+aDDCLYhf9/bD2TwSO8u8jDSmMUd2SUVO4gCnU8= +github.com/AlecAivazis/survey/v2 v2.3.2/go.mod h1:TH2kPCDU3Kqq7pLbnCWwZXDBjnhZtmsCle5EiYDJ2fg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= @@ -18,8 +18,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc= -github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= @@ -44,11 +44,13 @@ github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kyokomi/emoji/v2 v2.2.8 h1:jcofPxjHWEkJtkIbcLHvZhxKgCPl6C7MyjTrD4KDqUE= github.com/kyokomi/emoji/v2 v2.2.8/go.mod h1:JUcn42DTdsXJo1SWanHh4HKDEyPaR5CqkmoirZZP9qE= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.11 h1:nQ+aFkoE2TMGc0b68U2OKSexC+eq46+XwZzWXHRmPYs= +github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= @@ -89,8 +91,10 @@ golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 h1:foEbQz/B0Oz6YIqu/69kfXPYeFQAuuMYFkjaqXzl5Wo= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= From 9558380243a4ec600cc9d2481235852f27b7457a Mon Sep 17 00:00:00 2001 From: Manuel Vogel Date: Tue, 14 Dec 2021 13:23:54 +0100 Subject: [PATCH 56/82] chore: ignore .vscode --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index c331ce69..8ce7945e 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,9 @@ Icon *.iml .idea +# vscode IDE +.vscode + # Files that might appear in the root of a volume .DocumentRevisions-V100 .fseventsd From 03f0a44924bad691e2551a268f6566806441e3f5 Mon Sep 17 00:00:00 2001 From: Manuel Vogel Date: Tue, 14 Dec 2021 13:25:51 +0100 Subject: [PATCH 57/82] chore: update changelog for v0.15.1 --- CHANGELOG.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cff4c0df..270d13fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ ## [Unreleased] + +## [v0.15.1] - 2021-12-14 +### Bug Fixes +- **deps:** update all non-major dependencies ([#179](https://github.com/git-chglog/git-chglog/issues/179)) +- **deps:** update module github.com/andygrunwald/go-jira to v1.14.0 ([#167](https://github.com/git-chglog/git-chglog/issues/167)) +- **deps:** update module github.com/alecaivazis/survey/v2 to v2.2.16 ([#165](https://github.com/git-chglog/git-chglog/issues/165)) +- **deps:** update module github.com/alecaivazis/survey/v2 to v2.2.15 ([#163](https://github.com/git-chglog/git-chglog/issues/163)) + +### Chores +- ignore .vscode +- **deps:** update all non-major dependencies docker tags ([#168](https://github.com/git-chglog/git-chglog/issues/168)) + + ## [v0.15.0] - 2021-07-09 ### Bug Fixes @@ -12,6 +25,7 @@ - **deps:** update module github.com/alecaivazis/survey/v2 to v2.2.12 ([#147](https://github.com/git-chglog/git-chglog/issues/147)) ### Chores +- update changelog for v0.15.0 - **deps:** update alpine docker tag to v3.14.0 ([#153](https://github.com/git-chglog/git-chglog/issues/153)) ### Features @@ -384,7 +398,8 @@ - First implement -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.15.0...HEAD +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.15.1...HEAD +[v0.15.1]: https://github.com/git-chglog/git-chglog/compare/v0.15.0...v0.15.1 [v0.15.0]: https://github.com/git-chglog/git-chglog/compare/v0.14.2...v0.15.0 [v0.14.2]: https://github.com/git-chglog/git-chglog/compare/v0.14.1...v0.14.2 [v0.14.1]: https://github.com/git-chglog/git-chglog/compare/v0.14.0...v0.14.1 From d1dc1da7443af992e27854d972913b7db317f62f Mon Sep 17 00:00:00 2001 From: Manuel Vogel Date: Sun, 22 Jan 2023 11:56:18 +0100 Subject: [PATCH 58/82] chore: bump golang to 1.19 (#218) * chore: bump golang to 1.19 Signed-off-by: Manuel Vogel * fix: [#212] Vulnerabilities. (#219) Co-authored-by: Manuel Vogel * chore: bump all dependencies Signed-off-by: Manuel Vogel * chore(deps): update actions/setup-go action to v3 (#202) Co-authored-by: Renovate Bot * chore(deps): update actions/checkout action to v3 (#201) Co-authored-by: Renovate Bot * chore(deps): update golangci/golangci-lint-action action to v3 (#203) Co-authored-by: Renovate Bot * chore(ci): add explicit go setup before linting Signed-off-by: Manuel Vogel * chore(ci): bump golangci to v1.50.1 Signed-off-by: Manuel Vogel * chore: go fmt Signed-off-by: Manuel Vogel * chore: ignore staticcheck for strings.Title Signed-off-by: Manuel Vogel * chore: reaplce all ioutil with os funcs Signed-off-by: Manuel Vogel * chore ignore file read sec check Signed-off-by: Manuel Vogel * fix: remove unnecessary if before trimPrefix Signed-off-by: Manuel Vogel Signed-off-by: Manuel Vogel Co-authored-by: Ben van B <030@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Renovate Bot --- .github/workflows/ci.yml | 17 +++--- .github/workflows/publish.yml | 6 +-- .github/workflows/release.yml | 6 +-- README.md | 9 ++-- chglog.go | 9 ++-- cmd/git-chglog/config_loader.go | 4 +- cmd/git-chglog/fs.go | 4 +- commit_extractor.go | 1 + commit_parser_test.go | 5 +- go.mod | 45 +++++++++++++--- go.sum | 93 ++++++++++++++++++--------------- processor.go | 14 ++--- tag_reader.go | 5 +- utils.go | 1 + 14 files changed, 132 insertions(+), 87 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 139168a5..77d4a712 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,20 +12,20 @@ on: - "README.md" env: - GO_VERSION: "1.16" - GOLANGCI_VERSION: "v1.38" + GO_VERSION: "1.19" + GOLANGCI_VERSION: "v1.50.1" jobs: tests: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} @@ -46,11 +46,16 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + - name: golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3 with: version: ${{ env.GOLANGCI_VERSION }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5b52a901..2205dc1e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,7 +6,7 @@ on: - master env: - GO_VERSION: "1.16" + GO_VERSION: "1.19" DOCKER_REGISTRY: "quay.io" jobs: @@ -14,12 +14,12 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 812a8488..3599f772 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: - "*" env: - GO_VERSION: "1.16" + GO_VERSION: "1.19" DOCKER_REGISTRY: "quay.io" jobs: @@ -14,12 +14,12 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} diff --git a/README.md b/README.md index be6c636f..8ce75a6c 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ - [Scoop (for Windows users)](#scoop-for-windows-users) - [asdf](#asdf) - [Go users](#go-users) + - [Docker](#docker) - [Test Installation](#test-installation) - [Quick Start](#quick-start) - [CLI Usage](#cli-usage) @@ -32,6 +33,7 @@ - [`template`](#template) - [`info`](#info) - [`options`](#options) + - [`options.sort`](#optionssort) - [`options.commits`](#optionscommits) - [`options.commit_groups`](#optionscommit_groups) - [`options.header`](#optionsheader) @@ -50,8 +52,9 @@ - [TODO](#todo) - [Thanks](#thanks) - [Contributing](#contributing) - - [Development](#development) - - [Feedback](#feedback) + - [Development](#development) + - [Release Process](#release-process) + - [Feedback](#feedback) - [CHANGELOG](#changelog) - [Related Projects](#related-projects) - [License](#license) @@ -683,7 +686,7 @@ We alway welcome your contributions :clap: ## Development -1. Use Golang version `>= 1.16` +1. Use Golang version `>= 1.19` 1. Fork (https://github.com/git-chglog/git-chglog) :tada: 1. Create a feature branch :coffee: 1. Run test suite with the `$ make test` command and confirm that it passes :zap: diff --git a/chglog.go b/chglog.go index 1a084c8a..fc5cf9e3 100644 --- a/chglog.go +++ b/chglog.go @@ -132,10 +132,11 @@ func NewGenerator(logger *Logger, config *Config) *Generator { // Generate gets the commit based on the specified tag `query` and writes the result to `io.Writer` // // tag `query` can be specified with the following rule -// .. - Commit contained in `` tags from `` (e.g. `1.0.0..2.0.0`) -// .. - Commit from the `` to the latest tag (e.g. `1.0.0..`) -// .. - Commit from the oldest tag to `` (e.g. `..1.0.0`) -// - Commit contained in `` (e.g. `1.0.0`) +// +// .. - Commit contained in `` tags from `` (e.g. `1.0.0..2.0.0`) +// .. - Commit from the `` to the latest tag (e.g. `1.0.0..`) +// .. - Commit from the oldest tag to `` (e.g. `..1.0.0`) +// - Commit contained in `` (e.g. `1.0.0`) func (gen *Generator) Generate(w io.Writer, query string) error { back, err := gen.workdir() if err != nil { diff --git a/cmd/git-chglog/config_loader.go b/cmd/git-chglog/config_loader.go index d49eb779..2600dfec 100644 --- a/cmd/git-chglog/config_loader.go +++ b/cmd/git-chglog/config_loader.go @@ -1,7 +1,7 @@ package main import ( - "io/ioutil" + "os" "path/filepath" "gopkg.in/yaml.v2" @@ -22,7 +22,7 @@ func NewConfigLoader() ConfigLoader { func (loader *configLoaderImpl) Load(path string) (*Config, error) { fp := filepath.Clean(path) - bytes, err := ioutil.ReadFile(fp) + bytes, err := os.ReadFile(fp) if err != nil { return nil, err } diff --git a/cmd/git-chglog/fs.go b/cmd/git-chglog/fs.go index 1617e0bb..9b091d89 100644 --- a/cmd/git-chglog/fs.go +++ b/cmd/git-chglog/fs.go @@ -2,7 +2,6 @@ package main import ( "io" - "io/ioutil" "os" ) @@ -41,9 +40,10 @@ func (*osFileSystem) MkdirP(path string) error { } func (*osFileSystem) Create(name string) (File, error) { + //nolint: gosec return os.Create(name) } func (*osFileSystem) WriteFile(path string, content []byte) error { - return ioutil.WriteFile(path, content, os.ModePerm) + return os.WriteFile(path, content, os.ModePerm) } diff --git a/commit_extractor.go b/commit_extractor.go index c5921ca7..1c4fc2ad 100644 --- a/commit_extractor.go +++ b/commit_extractor.go @@ -119,6 +119,7 @@ func (e *commitExtractor) commitGroupTitle(commit *Commit) (string, string) { if t, ok := e.opts.CommitGroupTitleMaps[v]; ok { ttl = t } else { + //nolint:staticcheck ttl = strings.Title(raw) } } diff --git a/commit_parser_test.go b/commit_parser_test.go index 93eec18b..600d1163 100644 --- a/commit_parser_test.go +++ b/commit_parser_test.go @@ -3,7 +3,6 @@ package chglog import ( "errors" "fmt" - "io/ioutil" "os" "path/filepath" "testing" @@ -23,7 +22,7 @@ func TestCommitParserParse(t *testing.T) { return "", errors.New("") } - bytes, _ := ioutil.ReadFile(filepath.Join("testdata", "gitlog.txt")) + bytes, _ := os.ReadFile(filepath.Join("testdata", "gitlog.txt")) return string(bytes), nil }, @@ -376,7 +375,7 @@ func TestCommitParserParseWithJira(t *testing.T) { return "", errors.New("") } - bytes, _ := ioutil.ReadFile(filepath.Join("testdata", "gitlog_jira.txt")) + bytes, _ := os.ReadFile(filepath.Join("testdata", "gitlog_jira.txt")) return string(bytes), nil }, diff --git a/go.mod b/go.mod index fe01f655..60e67e9e 100644 --- a/go.mod +++ b/go.mod @@ -1,18 +1,47 @@ module github.com/git-chglog/git-chglog -go 1.16 +go 1.19 require ( - github.com/AlecAivazis/survey/v2 v2.3.2 + github.com/AlecAivazis/survey/v2 v2.3.6 github.com/Masterminds/sprig/v3 v3.2.2 - github.com/andygrunwald/go-jira v1.14.0 + github.com/andygrunwald/go-jira v1.16.0 github.com/coreos/go-semver v0.3.0 github.com/fatih/color v1.13.0 - github.com/imdario/mergo v0.3.12 - github.com/kyokomi/emoji/v2 v2.2.8 - github.com/mattn/go-colorable v0.1.11 - github.com/stretchr/testify v1.7.0 + github.com/imdario/mergo v0.3.13 + github.com/kyokomi/emoji/v2 v2.2.10 + github.com/mattn/go-colorable v0.1.13 + github.com/stretchr/testify v1.8.1 github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df - github.com/urfave/cli/v2 v2.3.0 + github.com/urfave/cli/v2 v2.23.5 gopkg.in/yaml.v2 v2.4.0 ) + +require ( + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/semver/v3 v3.1.1 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/fatih/structs v1.1.0 // indirect + github.com/golang-jwt/jwt/v4 v4.4.2 // indirect + github.com/google/go-querystring v1.1.0 // indirect + github.com/google/uuid v1.1.1 // indirect + github.com/huandu/xstrings v1.3.1 // indirect + github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect + github.com/mitchellh/copystructure v1.0.0 // indirect + github.com/mitchellh/reflectwalk v1.0.0 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/shopspring/decimal v1.2.0 // indirect + github.com/spf13/cast v1.3.1 // indirect + github.com/trivago/tgo v1.0.7 // indirect + github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect + golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b // indirect + golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect + golang.org/x/term v0.0.0-20210503060354-a79de5458b56 // indirect + golang.org/x/text v0.3.8 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/go.sum b/go.sum index 9e37ce7f..535d18d8 100644 --- a/go.sum +++ b/go.sum @@ -1,20 +1,21 @@ -github.com/AlecAivazis/survey/v2 v2.3.2 h1:TqTB+aDDCLYhf9/bD2TwSO8u8jDSmMUd2SUVO4gCnU8= -github.com/AlecAivazis/survey/v2 v2.3.2/go.mod h1:TH2kPCDU3Kqq7pLbnCWwZXDBjnhZtmsCle5EiYDJ2fg= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/AlecAivazis/survey/v2 v2.3.6 h1:NvTuVHISgTHEHeBFqt6BHOe4Ny/NwGZr7w+F8S9ziyw= +github.com/AlecAivazis/survey/v2 v2.3.6/go.mod h1:4AuI9b7RjAR+G7v9+C4YSlX/YL3K3cWNXgWXOhllqvI= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= -github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8 h1:xzYJEypr/85nBpB11F9br+3HUrpgb+fcm5iADzXXYEw= -github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc= -github.com/andygrunwald/go-jira v1.14.0 h1:7GT/3qhar2dGJ0kq8w0d63liNyHOnxZsUZ9Pe4+AKBI= -github.com/andygrunwald/go-jira v1.14.0/go.mod h1:KMo2f4DgMZA1C9FdImuLc04x4WQhn5derQpnsuBFgqE= +github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s= +github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w= +github.com/andygrunwald/go-jira v1.16.0 h1:PU7C7Fkk5L96JvPc6vDVIrd99vdPnYudHu4ju2c2ikQ= +github.com/andygrunwald/go-jira v1.16.0/go.mod h1:UQH4IBVxIYWbgagc0LF/k9FRs9xjIiQ8hIcC6HfLwFU= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI= +github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -22,35 +23,35 @@ github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 h1:zLTLjkaOFEFIOxY5BWLFLwh+cL8vOBW4XJ2aqLE/Tf0= -github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= +github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174 h1:WlZsjVhE8Af9IcZDGgJGQpNflI3+MJSBhsgT5PCtzBQ= -github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A= +github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog= +github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68= github.com/huandu/xstrings v1.3.1 h1:4jgBlKK6tLKFvO8u5pmYjG91cqytmDCDvGh7ECVFfFs= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kr/pty v1.1.4 h1:5Myjjh3JY/NaAi4IsUbHADytDyl1VE1Y9PXDlL+P/VQ= -github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kyokomi/emoji/v2 v2.2.8 h1:jcofPxjHWEkJtkIbcLHvZhxKgCPl6C7MyjTrD4KDqUE= -github.com/kyokomi/emoji/v2 v2.2.8/go.mod h1:JUcn42DTdsXJo1SWanHh4HKDEyPaR5CqkmoirZZP9qE= +github.com/kyokomi/emoji/v2 v2.2.10 h1:1z5eMVcxFifsmEoNpdeq4UahbcicgQ4FEHuzrCVwmiI= +github.com/kyokomi/emoji/v2 v2.2.10/go.mod h1:JUcn42DTdsXJo1SWanHh4HKDEyPaR5CqkmoirZZP9qE= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11 h1:nQ+aFkoE2TMGc0b68U2OKSexC+eq46+XwZzWXHRmPYs= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= @@ -61,30 +62,34 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/trivago/tgo v1.0.7 h1:uaWH/XIy9aWYWpjm2CU3RpcqZXmX2ysQ9/Go+d9gyrM= github.com/trivago/tgo v1.0.7/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkFnhc= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df h1:Y2l28Jr3vOEeYtxfVbMtVfOdAwuUqWaP9fvNKiBVeXY= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df/go.mod h1:pnyouUty/nBr/zm3GYwTIt+qFTLWbdjeLjZmJdzJOu8= -github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +github.com/urfave/cli/v2 v2.23.5 h1:xbrU7tAYviSpqeR3X4nEFWUdB/uDZ6DE+HxmRU7Xtyw= +github.com/urfave/cli/v2 v2.23.5/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200414173820-0848c9571904 h1:bXoxMPcSLOq08zI3/c5dEBT6lE4eh+jOh886GHrn6V8= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b h1:Qwe1rC8PSniVfAFPFJeyUkB+zcysC3RgJBAGk7eqBEU= +golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -93,22 +98,26 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 h1:foEbQz/B0Oz6YIqu/69kfXPYeFQAuuMYFkjaqXzl5Wo= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3aEtzyuh2mPt3l/CkeU= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/processor.go b/processor.go index 06580408..194fccd6 100644 --- a/processor.go +++ b/processor.go @@ -14,8 +14,8 @@ type Processor interface { // GitHubProcessor is optimized for CHANGELOG used in GitHub // // The following processing is performed -// - Mentions automatic link (@tsuyoshiwada -> [@tsuyoshiwada](https://github.com/tsuyoshiwada)) -// - Automatic link to references (#123 -> [#123](https://github.com/owner/repo/issues/123)) +// - Mentions automatic link (@tsuyoshiwada -> [@tsuyoshiwada](https://github.com/tsuyoshiwada)) +// - Automatic link to references (#123 -> [#123](https://github.com/owner/repo/issues/123)) type GitHubProcessor struct { Host string // Host name used for link destination. Note: You must include the protocol (e.g. "https://github.com") config *Config @@ -69,9 +69,9 @@ func (p *GitHubProcessor) addLinks(input string) string { // GitLabProcessor is optimized for CHANGELOG used in GitLab // // The following processing is performed -// - Mentions automatic link (@tsuyoshiwada -> [@tsuyoshiwada](https://gitlab.com/tsuyoshiwada)) -// - Automatic link to references issues (#123 -> [#123](https://gitlab.com/owner/repo/issues/123)) -// - Automatic link to references merge request (!123 -> [#123](https://gitlab.com/owner/repo/merge_requests/123)) +// - Mentions automatic link (@tsuyoshiwada -> [@tsuyoshiwada](https://gitlab.com/tsuyoshiwada)) +// - Automatic link to references issues (#123 -> [#123](https://gitlab.com/owner/repo/issues/123)) +// - Automatic link to references merge request (!123 -> [#123](https://gitlab.com/owner/repo/merge_requests/123)) type GitLabProcessor struct { Host string // Host name used for link destination. Note: You must include the protocol (e.g. "https://gitlab.com") config *Config @@ -130,8 +130,8 @@ func (p *GitLabProcessor) addLinks(input string) string { // BitbucketProcessor is optimized for CHANGELOG used in Bitbucket // // The following processing is performed -// - Mentions automatic link (@tsuyoshiwada -> [@tsuyoshiwada](https://bitbucket.org/tsuyoshiwada/)) -// - Automatic link to references (#123 -> [#123](https://bitbucket.org/owner/repo/issues/123/)) +// - Mentions automatic link (@tsuyoshiwada -> [@tsuyoshiwada](https://bitbucket.org/tsuyoshiwada/)) +// - Automatic link to references (#123 -> [#123](https://bitbucket.org/owner/repo/issues/123/)) type BitbucketProcessor struct { Host string // Host name used for link destination. Note: You must include the protocol (e.g. "https://bitbucket.org") config *Config diff --git a/tag_reader.go b/tag_reader.go index 754cb633..fb2cc3f4 100644 --- a/tag_reader.go +++ b/tag_reader.go @@ -91,10 +91,7 @@ func (*tagReader) filterSemVerTags(tags *[]*Tag) { for i, t := range *tags { // remove leading v, since its so // common. - name := t.Name - if strings.HasPrefix(name, "v") { - name = strings.TrimPrefix(name, "v") - } + name := strings.TrimPrefix(t.Name, "v") // attempt semver parse, if not successful // remove it from tags slice. diff --git a/utils.go b/utils.go index a67a29ad..ccf866a3 100644 --- a/utils.go +++ b/utils.go @@ -23,6 +23,7 @@ func dotGet(target interface{}, prop string) (interface{}, bool) { value = reflect.ValueOf(target) } + //nolint:staticcheck field := value.FieldByName(strings.Title(key)) if !field.IsValid() { return nil, false From 66a1d9ea5a1c044c2b3acd6b6ca06e941a0516f2 Mon Sep 17 00:00:00 2001 From: Benjamin K <53038537+treee111@users.noreply.github.com> Date: Sun, 22 Jan 2023 11:57:26 +0100 Subject: [PATCH 59/82] fix: typo in readme (#196) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ce75a6c..572ab22e 100644 --- a/README.md +++ b/README.md @@ -682,7 +682,7 @@ Within a `Commit`, the following Jira data can be used in template: ## Contributing -We alway welcome your contributions :clap: +We always welcome your contributions :clap: ## Development From cbab5b89dcd888e0b6cbe7985ae457c8240c85a7 Mon Sep 17 00:00:00 2001 From: Orpheus Lummis Date: Sun, 22 Jan 2023 10:57:59 +0000 Subject: [PATCH 60/82] chore: update Go install instructions (#205) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 572ab22e..3e767100 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ asdf install git-chglog latest #### Go users ```bash -go get -u github.com/git-chglog/git-chglog/cmd/git-chglog +go install github.com/git-chglog/git-chglog/cmd/git-chglog@latest ``` ### [Docker](https://www.docker.com/) From 5896ad91ce1e104d7b8a00a38996cb81fb567d1b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 22 Jan 2023 11:59:09 +0100 Subject: [PATCH 61/82] fix(deps): update module gopkg.in/yaml.v2 to v3 (#221) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 60e67e9e..18770b9f 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,8 @@ require ( github.com/stretchr/testify v1.8.1 github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df github.com/urfave/cli/v2 v2.23.5 - gopkg.in/yaml.v2 v2.4.0 + gopkg.in/yaml.v2 v2.3.0 + gopkg.in/yaml.v3 v3.0.1 ) require ( @@ -43,5 +44,4 @@ require ( golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect golang.org/x/term v0.0.0-20210503060354-a79de5458b56 // indirect golang.org/x/text v0.3.8 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 535d18d8..7ac3e189 100644 --- a/go.sum +++ b/go.sum @@ -114,6 +114,7 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= From 4f3ff62db6e687fb6557f59be7ec4020a40fc8b8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 22 Jan 2023 12:01:00 +0100 Subject: [PATCH 62/82] chore(deps): update all non-major dependencies (#220) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Dockerfile | 2 +- go.mod | 24 +++++++++++----------- go.sum | 60 ++++++++++++++++++++++++++++++++++-------------------- 3 files changed, 51 insertions(+), 35 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6dcc2972..eb383a99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.14.2 +FROM alpine:3.17.1 RUN apk add --no-cache git && \ mkdir /workdir diff --git a/go.mod b/go.mod index 18770b9f..327f4fd2 100644 --- a/go.mod +++ b/go.mod @@ -4,30 +4,29 @@ go 1.19 require ( github.com/AlecAivazis/survey/v2 v2.3.6 - github.com/Masterminds/sprig/v3 v3.2.2 + github.com/Masterminds/sprig/v3 v3.2.3 github.com/andygrunwald/go-jira v1.16.0 - github.com/coreos/go-semver v0.3.0 + github.com/coreos/go-semver v0.3.1 github.com/fatih/color v1.13.0 github.com/imdario/mergo v0.3.13 - github.com/kyokomi/emoji/v2 v2.2.10 + github.com/kyokomi/emoji/v2 v2.2.11 github.com/mattn/go-colorable v0.1.13 github.com/stretchr/testify v1.8.1 github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df - github.com/urfave/cli/v2 v2.23.5 - gopkg.in/yaml.v2 v2.3.0 - gopkg.in/yaml.v3 v3.0.1 + github.com/urfave/cli/v2 v2.23.7 + gopkg.in/yaml.v2 v2.4.0 ) require ( github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.1.1 // indirect + github.com/Masterminds/semver/v3 v3.2.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/golang-jwt/jwt/v4 v4.4.2 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/uuid v1.1.1 // indirect - github.com/huandu/xstrings v1.3.1 // indirect + github.com/huandu/xstrings v1.3.3 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/mattn/go-isatty v0.0.16 // indirect github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect @@ -40,8 +39,9 @@ require ( github.com/spf13/cast v1.3.1 // indirect github.com/trivago/tgo v1.0.7 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b // indirect - golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect - golang.org/x/term v0.0.0-20210503060354-a79de5458b56 // indirect - golang.org/x/text v0.3.8 // indirect + golang.org/x/crypto v0.3.0 // indirect + golang.org/x/sys v0.2.0 // indirect + golang.org/x/term v0.2.0 // indirect + golang.org/x/text v0.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 7ac3e189..170d580e 100644 --- a/go.sum +++ b/go.sum @@ -2,16 +2,16 @@ github.com/AlecAivazis/survey/v2 v2.3.6 h1:NvTuVHISgTHEHeBFqt6BHOe4Ny/NwGZr7w+F8 github.com/AlecAivazis/survey/v2 v2.3.6/go.mod h1:4AuI9b7RjAR+G7v9+C4YSlX/YL3K3cWNXgWXOhllqvI= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= -github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= +github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= +github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s= github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w= github.com/andygrunwald/go-jira v1.16.0 h1:PU7C7Fkk5L96JvPc6vDVIrd99vdPnYudHu4ju2c2ikQ= github.com/andygrunwald/go-jira v1.16.0/go.mod h1:UQH4IBVxIYWbgagc0LF/k9FRs9xjIiQ8hIcC6HfLwFU= -github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= +github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI= @@ -34,15 +34,15 @@ github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68= -github.com/huandu/xstrings v1.3.1 h1:4jgBlKK6tLKFvO8u5pmYjG91cqytmDCDvGh7ECVFfFs= -github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= +github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kyokomi/emoji/v2 v2.2.10 h1:1z5eMVcxFifsmEoNpdeq4UahbcicgQ4FEHuzrCVwmiI= -github.com/kyokomi/emoji/v2 v2.2.10/go.mod h1:JUcn42DTdsXJo1SWanHh4HKDEyPaR5CqkmoirZZP9qE= +github.com/kyokomi/emoji/v2 v2.2.11 h1:Pf/ZWVTbnAVkHOLJLWjPxM/FmgyPe+d85cv/OLP5Yus= +github.com/kyokomi/emoji/v2 v2.2.11/go.mod h1:JUcn42DTdsXJo1SWanHh4HKDEyPaR5CqkmoirZZP9qE= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -82,39 +82,55 @@ github.com/trivago/tgo v1.0.7 h1:uaWH/XIy9aWYWpjm2CU3RpcqZXmX2ysQ9/Go+d9gyrM= github.com/trivago/tgo v1.0.7/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkFnhc= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df h1:Y2l28Jr3vOEeYtxfVbMtVfOdAwuUqWaP9fvNKiBVeXY= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df/go.mod h1:pnyouUty/nBr/zm3GYwTIt+qFTLWbdjeLjZmJdzJOu8= -github.com/urfave/cli/v2 v2.23.5 h1:xbrU7tAYviSpqeR3X4nEFWUdB/uDZ6DE+HxmRU7Xtyw= -github.com/urfave/cli/v2 v2.23.5/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/urfave/cli/v2 v2.23.7 h1:YHDQ46s3VghFHFf1DdF+Sh7H4RqhcM+t0TmZRJx4oJY= +github.com/urfave/cli/v2 v2.23.7/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b h1:Qwe1rC8PSniVfAFPFJeyUkB+zcysC3RgJBAGk7eqBEU= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.3.0 h1:a06MkbcxBrEFc0w0QIZWXrH/9cCX6KJyWbBOIwAn+7A= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3aEtzyuh2mPt3l/CkeU= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= From 36320619c5ecfee569aeea932f82221333017a73 Mon Sep 17 00:00:00 2001 From: Manuel Vogel Date: Sun, 22 Jan 2023 12:04:33 +0100 Subject: [PATCH 63/82] chore: update changelog for v0.15.2 --- CHANGELOG.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 270d13fd..4db541e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ ## [Unreleased] + +## [v0.15.2] - 2023-01-22 +### Bug Fixes +- typo in readme ([#196](https://github.com/git-chglog/git-chglog/issues/196)) +- **deps:** update module gopkg.in/yaml.v2 to v3 ([#221](https://github.com/git-chglog/git-chglog/issues/221)) + +### Chores +- update Go install instructions ([#205](https://github.com/git-chglog/git-chglog/issues/205)) +- bump golang to 1.19 ([#218](https://github.com/git-chglog/git-chglog/issues/218)) +- **deps:** update all non-major dependencies ([#220](https://github.com/git-chglog/git-chglog/issues/220)) + + ## [v0.15.1] - 2021-12-14 ### Bug Fixes @@ -11,6 +23,7 @@ - **deps:** update module github.com/alecaivazis/survey/v2 to v2.2.15 ([#163](https://github.com/git-chglog/git-chglog/issues/163)) ### Chores +- update changelog for v0.15.1 - ignore .vscode - **deps:** update all non-major dependencies docker tags ([#168](https://github.com/git-chglog/git-chglog/issues/168)) @@ -398,7 +411,8 @@ - First implement -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.15.1...HEAD +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.15.2...HEAD +[v0.15.2]: https://github.com/git-chglog/git-chglog/compare/v0.15.1...v0.15.2 [v0.15.1]: https://github.com/git-chglog/git-chglog/compare/v0.15.0...v0.15.1 [v0.15.0]: https://github.com/git-chglog/git-chglog/compare/v0.14.2...v0.15.0 [v0.14.2]: https://github.com/git-chglog/git-chglog/compare/v0.14.1...v0.14.2 From 7d4f3e8dffaf39e1ec5f6066533c7133560e387e Mon Sep 17 00:00:00 2001 From: Manuel Vogel Date: Sun, 22 Jan 2023 12:06:25 +0100 Subject: [PATCH 64/82] chore: update changelog for v0.15.2 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4db541e4..e1c01bc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - **deps:** update module gopkg.in/yaml.v2 to v3 ([#221](https://github.com/git-chglog/git-chglog/issues/221)) ### Chores +- update changelog for v0.15.2 - update Go install instructions ([#205](https://github.com/git-chglog/git-chglog/issues/205)) - bump golang to 1.19 ([#218](https://github.com/git-chglog/git-chglog/issues/218)) - **deps:** update all non-major dependencies ([#220](https://github.com/git-chglog/git-chglog/issues/220)) From 1dbe8da4a3817e9fe3beba5aab69d8073fda8291 Mon Sep 17 00:00:00 2001 From: Manuel Vogel Date: Mon, 23 Jan 2023 09:53:30 +0100 Subject: [PATCH 65/82] chore: bump goreleaser/goreleaser-action to v4. Closes #208 Signed-off-by: Manuel Vogel --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3599f772..b121dd15 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: password: ${{ secrets.QUAY_IO_TOKEN }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v4 with: version: latest args: release --rm-dist From 13cb5b3dc4b18a39f79df72ae75d9fc1c700dff5 Mon Sep 17 00:00:00 2001 From: Manuel Vogel Date: Mon, 23 Jan 2023 09:55:36 +0100 Subject: [PATCH 66/82] chore: bump docker/login-action to v2. Closes #206 Signed-off-by: Manuel Vogel --- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2205dc1e..b3240e56 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,7 +24,7 @@ jobs: go-version: ${{ env.GO_VERSION }} - name: Login to Docker Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ${{ env.DOCKER_REGISTRY }} username: ${{ secrets.QUAY_IO_USER }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b121dd15..69bc2951 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: go-version: ${{ env.GO_VERSION }} - name: Login to Docker Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ${{ env.DOCKER_REGISTRY }} username: ${{ secrets.QUAY_IO_USER }} From 6ff4d21a0e50ba2706030371e114a47901085596 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 09:58:25 +0100 Subject: [PATCH 67/82] fix(deps): update all non-major dependencies (#223) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 8 ++++---- go.sum | 20 ++++++++------------ 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 327f4fd2..ff4e6ed2 100644 --- a/go.mod +++ b/go.mod @@ -7,13 +7,13 @@ require ( github.com/Masterminds/sprig/v3 v3.2.3 github.com/andygrunwald/go-jira v1.16.0 github.com/coreos/go-semver v0.3.1 - github.com/fatih/color v1.13.0 + github.com/fatih/color v1.14.0 github.com/imdario/mergo v0.3.13 github.com/kyokomi/emoji/v2 v2.2.11 github.com/mattn/go-colorable v0.1.13 github.com/stretchr/testify v1.8.1 github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df - github.com/urfave/cli/v2 v2.23.7 + github.com/urfave/cli/v2 v2.24.1 gopkg.in/yaml.v2 v2.4.0 ) @@ -28,7 +28,7 @@ require ( github.com/google/uuid v1.1.1 // indirect github.com/huandu/xstrings v1.3.3 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/reflectwalk v1.0.0 // indirect @@ -40,7 +40,7 @@ require ( github.com/trivago/tgo v1.0.7 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect golang.org/x/crypto v0.3.0 // indirect - golang.org/x/sys v0.2.0 // indirect + golang.org/x/sys v0.3.0 // indirect golang.org/x/term v0.2.0 // indirect golang.org/x/text v0.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 170d580e..1e00699e 100644 --- a/go.sum +++ b/go.sum @@ -19,8 +19,8 @@ github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.14.0 h1:AD//feEuOKJSzxN81txMW47CNX1EW6kMVEPt4lePhtE= +github.com/fatih/color v1.14.0/go.mod h1:Ywr2WOhTEN4nsWMWU8I8GWIG5z8rhJEa0ukvJDOfSPY= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= @@ -44,14 +44,12 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:C github.com/kyokomi/emoji/v2 v2.2.11 h1:Pf/ZWVTbnAVkHOLJLWjPxM/FmgyPe+d85cv/OLP5Yus= github.com/kyokomi/emoji/v2 v2.2.11/go.mod h1:JUcn42DTdsXJo1SWanHh4HKDEyPaR5CqkmoirZZP9qE= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= @@ -82,8 +80,8 @@ github.com/trivago/tgo v1.0.7 h1:uaWH/XIy9aWYWpjm2CU3RpcqZXmX2ysQ9/Go+d9gyrM= github.com/trivago/tgo v1.0.7/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkFnhc= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df h1:Y2l28Jr3vOEeYtxfVbMtVfOdAwuUqWaP9fvNKiBVeXY= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df/go.mod h1:pnyouUty/nBr/zm3GYwTIt+qFTLWbdjeLjZmJdzJOu8= -github.com/urfave/cli/v2 v2.23.7 h1:YHDQ46s3VghFHFf1DdF+Sh7H4RqhcM+t0TmZRJx4oJY= -github.com/urfave/cli/v2 v2.23.7/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/urfave/cli/v2 v2.24.1 h1:/QYYr7g0EhwXEML8jO+8OYt5trPnLHS0p3mrgExJ5NU= +github.com/urfave/cli/v2 v2.24.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -100,18 +98,16 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= From f608376b8d687ee6854935e1868e2c15cd12853b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Jan 2023 07:27:10 +0100 Subject: [PATCH 68/82] fix(deps): update module github.com/fatih/color to v1.14.1 (#224) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ff4e6ed2..5de9bad0 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/Masterminds/sprig/v3 v3.2.3 github.com/andygrunwald/go-jira v1.16.0 github.com/coreos/go-semver v0.3.1 - github.com/fatih/color v1.14.0 + github.com/fatih/color v1.14.1 github.com/imdario/mergo v0.3.13 github.com/kyokomi/emoji/v2 v2.2.11 github.com/mattn/go-colorable v0.1.13 diff --git a/go.sum b/go.sum index 1e00699e..4378a943 100644 --- a/go.sum +++ b/go.sum @@ -19,8 +19,8 @@ github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fatih/color v1.14.0 h1:AD//feEuOKJSzxN81txMW47CNX1EW6kMVEPt4lePhtE= -github.com/fatih/color v1.14.0/go.mod h1:Ywr2WOhTEN4nsWMWU8I8GWIG5z8rhJEa0ukvJDOfSPY= +github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= +github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= From b0f4afeff49a51952d30e4e755d5e98d5facbf98 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 8 Feb 2023 15:01:44 +0100 Subject: [PATCH 69/82] fix(deps): update module github.com/urfave/cli/v2 to v2.24.3 (#227) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5de9bad0..de794c8f 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/mattn/go-colorable v0.1.13 github.com/stretchr/testify v1.8.1 github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df - github.com/urfave/cli/v2 v2.24.1 + github.com/urfave/cli/v2 v2.24.3 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index 4378a943..8227acf5 100644 --- a/go.sum +++ b/go.sum @@ -80,8 +80,8 @@ github.com/trivago/tgo v1.0.7 h1:uaWH/XIy9aWYWpjm2CU3RpcqZXmX2ysQ9/Go+d9gyrM= github.com/trivago/tgo v1.0.7/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkFnhc= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df h1:Y2l28Jr3vOEeYtxfVbMtVfOdAwuUqWaP9fvNKiBVeXY= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df/go.mod h1:pnyouUty/nBr/zm3GYwTIt+qFTLWbdjeLjZmJdzJOu8= -github.com/urfave/cli/v2 v2.24.1 h1:/QYYr7g0EhwXEML8jO+8OYt5trPnLHS0p3mrgExJ5NU= -github.com/urfave/cli/v2 v2.24.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/urfave/cli/v2 v2.24.3 h1:7Q1w8VN8yE0MJEHP06bv89PjYsN4IHWED2s1v/Zlfm0= +github.com/urfave/cli/v2 v2.24.3/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= From f3cf5b67a05f08beb3c25ce85ce7ae206ae23947 Mon Sep 17 00:00:00 2001 From: Manuel Vogel Date: Sat, 11 Feb 2023 10:54:32 +0100 Subject: [PATCH 70/82] fix(ci): add integration test with docker image (#226) * fix: add git safe directory for /workdir * chore: use docker staged build --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ Dockerfile | 25 ++++++++++++++++++++++--- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77d4a712..9f90b4ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,3 +59,32 @@ jobs: uses: golangci/golangci-lint-action@v3 with: version: ${{ env.GOLANGCI_VERSION }} + + integration-tests: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Updating and upgrading brew + if: matrix.os == 'macos-latest' + run: | + bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + brew --version + - name: Install docker-cli and start colima + if: matrix.os == 'macos-latest' + # https://github.com/docker/for-mac/issues/2359#issuecomment-943131345 + run: | + brew install docker + colima start + docker info + - name: Test docker image + run: | + docker build -t git-chglog:ci-build . + docker run -v ${GITHUB_WORKSPACE}:/workdir -w /workdir git-chglog:ci-build > ${GITHUB_WORKSPACE}/ci-build.md + head ${GITHUB_WORKSPACE}/ci-build.md \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index eb383a99..9812f737 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,28 @@ -FROM alpine:3.17.1 +################## +########## Builder +################## +FROM golang:1.19-alpine as builder + +RUN apk add --no-cache make git + +WORKDIR /build +COPY go.mod go.sum ./ +RUN go mod download + +COPY . . + +RUN make build + +################## +########## PROD +################## +FROM alpine RUN apk add --no-cache git && \ - mkdir /workdir + mkdir /workdir && \ + git config --global --add safe.directory /workdir -COPY git-chglog /usr/local/bin/git-chglog +COPY --from=builder /build/git-chglog /usr/local/bin/git-chglog WORKDIR /workdir RUN chmod +x /usr/local/bin/git-chglog From 26c9a7c721abea680d6b6e960ea56ea69c71314d Mon Sep 17 00:00:00 2001 From: Manuel Vogel Date: Sat, 11 Feb 2023 11:00:55 +0100 Subject: [PATCH 71/82] chore: update changelog for v0.15.3 --- CHANGELOG.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1c01bc5..a37fbd82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ ## [Unreleased] + +## [v0.15.3] - 2023-02-11 +### Bug Fixes +- **ci:** add integration test with docker image ([#226](https://github.com/git-chglog/git-chglog/issues/226)) +- **deps:** update module github.com/urfave/cli/v2 to v2.24.3 ([#227](https://github.com/git-chglog/git-chglog/issues/227)) +- **deps:** update module github.com/fatih/color to v1.14.1 ([#224](https://github.com/git-chglog/git-chglog/issues/224)) +- **deps:** update all non-major dependencies ([#223](https://github.com/git-chglog/git-chglog/issues/223)) + +### Chores +- bump docker/login-action to v2. Closes [#206](https://github.com/git-chglog/git-chglog/issues/206) +- bump goreleaser/goreleaser-action to v4. Closes [#208](https://github.com/git-chglog/git-chglog/issues/208) + + ## [v0.15.2] - 2023-01-22 ### Bug Fixes @@ -10,6 +23,7 @@ ### Chores - update changelog for v0.15.2 +- update changelog for v0.15.2 - update Go install instructions ([#205](https://github.com/git-chglog/git-chglog/issues/205)) - bump golang to 1.19 ([#218](https://github.com/git-chglog/git-chglog/issues/218)) - **deps:** update all non-major dependencies ([#220](https://github.com/git-chglog/git-chglog/issues/220)) @@ -412,7 +426,8 @@ - First implement -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.15.2...HEAD +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.15.3...HEAD +[v0.15.3]: https://github.com/git-chglog/git-chglog/compare/v0.15.2...v0.15.3 [v0.15.2]: https://github.com/git-chglog/git-chglog/compare/v0.15.1...v0.15.2 [v0.15.1]: https://github.com/git-chglog/git-chglog/compare/v0.15.0...v0.15.1 [v0.15.0]: https://github.com/git-chglog/git-chglog/compare/v0.14.2...v0.15.0 From 6ad9b5c2db1f14c33e1b325e974936839c090101 Mon Sep 17 00:00:00 2001 From: Manuel Vogel Date: Sat, 11 Feb 2023 11:50:26 +0100 Subject: [PATCH 72/82] fix: release process (#231) * chore: use --clean for goreleaser * fix(ci): add gorleaser test * fix(ci): prebuild binary in IT test * fix(ci): use only ubuntu for docker image tests --- .github/workflows/ci.yml | 50 ++++++++++++++++++++++------------- .github/workflows/release.yml | 2 +- Dockerfile | 20 +------------- 3 files changed, 33 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f90b4ea..ff8afb31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,31 +60,43 @@ jobs: with: version: ${{ env.GOLANGCI_VERSION }} - integration-tests: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] + docker-image-tests: + runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Updating and upgrading brew - if: matrix.os == 'macos-latest' - run: | - bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - brew --version - - name: Install docker-cli and start colima - if: matrix.os == 'macos-latest' - # https://github.com/docker/for-mac/issues/2359#issuecomment-943131345 - run: | - brew install docker - colima start - docker info + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Run tests + run: make build + - name: Test docker image run: | docker build -t git-chglog:ci-build . docker run -v ${GITHUB_WORKSPACE}:/workdir -w /workdir git-chglog:ci-build > ${GITHUB_WORKSPACE}/ci-build.md - head ${GITHUB_WORKSPACE}/ci-build.md \ No newline at end of file + head ${GITHUB_WORKSPACE}/ci-build.md + + goreleaser-test: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v4 + with: + version: latest + args: release --clean --skip-publish --snapshot diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69bc2951..ec262420 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,6 +34,6 @@ jobs: uses: goreleaser/goreleaser-action@v4 with: version: latest - args: release --rm-dist + args: release --clean env: GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }} diff --git a/Dockerfile b/Dockerfile index 9812f737..1df3acfd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,10 @@ -################## -########## Builder -################## -FROM golang:1.19-alpine as builder - -RUN apk add --no-cache make git - -WORKDIR /build -COPY go.mod go.sum ./ -RUN go mod download - -COPY . . - -RUN make build - -################## -########## PROD -################## FROM alpine RUN apk add --no-cache git && \ mkdir /workdir && \ git config --global --add safe.directory /workdir -COPY --from=builder /build/git-chglog /usr/local/bin/git-chglog +COPY git-chglog /usr/local/bin/git-chglog WORKDIR /workdir RUN chmod +x /usr/local/bin/git-chglog From 06336286cf6372a111c164b79e7c64b4c70c77ff Mon Sep 17 00:00:00 2001 From: Manuel Vogel Date: Sat, 11 Feb 2023 11:55:00 +0100 Subject: [PATCH 73/82] chore: update changelog for v0.15.3 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a37fbd82..24260742 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,12 +5,14 @@ ## [v0.15.3] - 2023-02-11 ### Bug Fixes +- release process ([#231](https://github.com/git-chglog/git-chglog/issues/231)) - **ci:** add integration test with docker image ([#226](https://github.com/git-chglog/git-chglog/issues/226)) - **deps:** update module github.com/urfave/cli/v2 to v2.24.3 ([#227](https://github.com/git-chglog/git-chglog/issues/227)) - **deps:** update module github.com/fatih/color to v1.14.1 ([#224](https://github.com/git-chglog/git-chglog/issues/224)) - **deps:** update all non-major dependencies ([#223](https://github.com/git-chglog/git-chglog/issues/223)) ### Chores +- update changelog for v0.15.3 - bump docker/login-action to v2. Closes [#206](https://github.com/git-chglog/git-chglog/issues/206) - bump goreleaser/goreleaser-action to v4. Closes [#208](https://github.com/git-chglog/git-chglog/issues/208) From 78063fb71f3fb43bd2792ed342dacd3b3b0c1ae0 Mon Sep 17 00:00:00 2001 From: Manuel Vogel Date: Wed, 15 Feb 2023 08:43:42 +0100 Subject: [PATCH 74/82] chore: new release due to shecksum mismatch. Closes #232 Signed-off-by: Manuel Vogel From d7f33d0797db87da8e6808a79a31089279644f92 Mon Sep 17 00:00:00 2001 From: Manuel Vogel Date: Wed, 15 Feb 2023 08:45:24 +0100 Subject: [PATCH 75/82] chore: update changelog for v0.15.4 --- CHANGELOG.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24260742..d25fac2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,8 @@ ## [Unreleased] - -## [v0.15.3] - 2023-02-11 + +## [v0.15.4] - 2023-02-15 ### Bug Fixes - release process ([#231](https://github.com/git-chglog/git-chglog/issues/231)) - **ci:** add integration test with docker image ([#226](https://github.com/git-chglog/git-chglog/issues/226)) @@ -12,6 +12,8 @@ - **deps:** update all non-major dependencies ([#223](https://github.com/git-chglog/git-chglog/issues/223)) ### Chores +- new release due to shecksum mismatch. Closes [#232](https://github.com/git-chglog/git-chglog/issues/232) +- update changelog for v0.15.3 - update changelog for v0.15.3 - bump docker/login-action to v2. Closes [#206](https://github.com/git-chglog/git-chglog/issues/206) - bump goreleaser/goreleaser-action to v4. Closes [#208](https://github.com/git-chglog/git-chglog/issues/208) @@ -428,8 +430,8 @@ - First implement -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.15.3...HEAD -[v0.15.3]: https://github.com/git-chglog/git-chglog/compare/v0.15.2...v0.15.3 +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v0.15.4...HEAD +[v0.15.4]: https://github.com/git-chglog/git-chglog/compare/v0.15.2...v0.15.4 [v0.15.2]: https://github.com/git-chglog/git-chglog/compare/v0.15.1...v0.15.2 [v0.15.1]: https://github.com/git-chglog/git-chglog/compare/v0.15.0...v0.15.1 [v0.15.0]: https://github.com/git-chglog/git-chglog/compare/v0.14.2...v0.15.0 From 09ccd2f09b5d393939da217f3e0fb8f5c2734d3e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Feb 2023 14:11:51 +0100 Subject: [PATCH 76/82] fix(deps): update module github.com/urfave/cli/v2 to v2.24.4 (#229) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index de794c8f..f57ff60d 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/mattn/go-colorable v0.1.13 github.com/stretchr/testify v1.8.1 github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df - github.com/urfave/cli/v2 v2.24.3 + github.com/urfave/cli/v2 v2.24.4 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index 8227acf5..26d55a7e 100644 --- a/go.sum +++ b/go.sum @@ -80,8 +80,8 @@ github.com/trivago/tgo v1.0.7 h1:uaWH/XIy9aWYWpjm2CU3RpcqZXmX2ysQ9/Go+d9gyrM= github.com/trivago/tgo v1.0.7/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkFnhc= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df h1:Y2l28Jr3vOEeYtxfVbMtVfOdAwuUqWaP9fvNKiBVeXY= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df/go.mod h1:pnyouUty/nBr/zm3GYwTIt+qFTLWbdjeLjZmJdzJOu8= -github.com/urfave/cli/v2 v2.24.3 h1:7Q1w8VN8yE0MJEHP06bv89PjYsN4IHWED2s1v/Zlfm0= -github.com/urfave/cli/v2 v2.24.3/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/urfave/cli/v2 v2.24.4 h1:0gyJJEBYtCV87zI/x2nZCPyDxD51K6xM8SkwjHFCNEU= +github.com/urfave/cli/v2 v2.24.4/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= From ffadcdb2f854dc3ae6895ec1a233e86758091c87 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 19 Feb 2023 22:34:31 +0100 Subject: [PATCH 77/82] fix(deps): update module github.com/kyokomi/emoji/v2 to v2.2.12 (#233) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f57ff60d..d74366ea 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/coreos/go-semver v0.3.1 github.com/fatih/color v1.14.1 github.com/imdario/mergo v0.3.13 - github.com/kyokomi/emoji/v2 v2.2.11 + github.com/kyokomi/emoji/v2 v2.2.12 github.com/mattn/go-colorable v0.1.13 github.com/stretchr/testify v1.8.1 github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df diff --git a/go.sum b/go.sum index 26d55a7e..1743202a 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,8 @@ github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kyokomi/emoji/v2 v2.2.11 h1:Pf/ZWVTbnAVkHOLJLWjPxM/FmgyPe+d85cv/OLP5Yus= -github.com/kyokomi/emoji/v2 v2.2.11/go.mod h1:JUcn42DTdsXJo1SWanHh4HKDEyPaR5CqkmoirZZP9qE= +github.com/kyokomi/emoji/v2 v2.2.12 h1:sSVA5nH9ebR3Zji1o31wu3yOwD1zKXQA2z0zUyeit60= +github.com/kyokomi/emoji/v2 v2.2.12/go.mod h1:JUcn42DTdsXJo1SWanHh4HKDEyPaR5CqkmoirZZP9qE= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= From d93ef22384cc1cd4452ede66d47b4d5755741cb5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 16:20:59 +0100 Subject: [PATCH 78/82] fix(deps): update all non-major dependencies (#236) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index d74366ea..108ffe38 100644 --- a/go.mod +++ b/go.mod @@ -7,13 +7,13 @@ require ( github.com/Masterminds/sprig/v3 v3.2.3 github.com/andygrunwald/go-jira v1.16.0 github.com/coreos/go-semver v0.3.1 - github.com/fatih/color v1.14.1 + github.com/fatih/color v1.15.0 github.com/imdario/mergo v0.3.13 github.com/kyokomi/emoji/v2 v2.2.12 github.com/mattn/go-colorable v0.1.13 - github.com/stretchr/testify v1.8.1 + github.com/stretchr/testify v1.8.2 github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df - github.com/urfave/cli/v2 v2.24.4 + github.com/urfave/cli/v2 v2.25.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -40,7 +40,7 @@ require ( github.com/trivago/tgo v1.0.7 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect golang.org/x/crypto v0.3.0 // indirect - golang.org/x/sys v0.3.0 // indirect + golang.org/x/sys v0.6.0 // indirect golang.org/x/term v0.2.0 // indirect golang.org/x/text v0.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 1743202a..cc4feda1 100644 --- a/go.sum +++ b/go.sum @@ -19,8 +19,8 @@ github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= -github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= @@ -74,14 +74,14 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/trivago/tgo v1.0.7 h1:uaWH/XIy9aWYWpjm2CU3RpcqZXmX2ysQ9/Go+d9gyrM= github.com/trivago/tgo v1.0.7/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkFnhc= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df h1:Y2l28Jr3vOEeYtxfVbMtVfOdAwuUqWaP9fvNKiBVeXY= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df/go.mod h1:pnyouUty/nBr/zm3GYwTIt+qFTLWbdjeLjZmJdzJOu8= -github.com/urfave/cli/v2 v2.24.4 h1:0gyJJEBYtCV87zI/x2nZCPyDxD51K6xM8SkwjHFCNEU= -github.com/urfave/cli/v2 v2.24.4/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/urfave/cli/v2 v2.25.0 h1:ykdZKuQey2zq0yin/l7JOm9Mh+pg72ngYMeB0ABn6q8= +github.com/urfave/cli/v2 v2.25.0/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -106,8 +106,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= From 09d3a6182114f206a02b5dd4f9dcf92a0b10a089 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 08:42:59 +0100 Subject: [PATCH 79/82] fix(deps): update all non-major dependencies (#240) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 14 +++++++------- go.sum | 34 ++++++++++++++-------------------- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index 108ffe38..5ee4682f 100644 --- a/go.mod +++ b/go.mod @@ -3,17 +3,17 @@ module github.com/git-chglog/git-chglog go 1.19 require ( - github.com/AlecAivazis/survey/v2 v2.3.6 + github.com/AlecAivazis/survey/v2 v2.3.7 github.com/Masterminds/sprig/v3 v3.2.3 github.com/andygrunwald/go-jira v1.16.0 github.com/coreos/go-semver v0.3.1 - github.com/fatih/color v1.15.0 - github.com/imdario/mergo v0.3.13 + github.com/fatih/color v1.16.0 + github.com/imdario/mergo v0.3.16 github.com/kyokomi/emoji/v2 v2.2.12 github.com/mattn/go-colorable v0.1.13 - github.com/stretchr/testify v1.8.2 + github.com/stretchr/testify v1.8.4 github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df - github.com/urfave/cli/v2 v2.25.0 + github.com/urfave/cli/v2 v2.27.1 gopkg.in/yaml.v2 v2.4.0 ) @@ -28,7 +28,7 @@ require ( github.com/google/uuid v1.1.1 // indirect github.com/huandu/xstrings v1.3.3 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/reflectwalk v1.0.0 // indirect @@ -40,7 +40,7 @@ require ( github.com/trivago/tgo v1.0.7 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect golang.org/x/crypto v0.3.0 // indirect - golang.org/x/sys v0.6.0 // indirect + golang.org/x/sys v0.14.0 // indirect golang.org/x/term v0.2.0 // indirect golang.org/x/text v0.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index cc4feda1..c0a2e4f2 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/AlecAivazis/survey/v2 v2.3.6 h1:NvTuVHISgTHEHeBFqt6BHOe4Ny/NwGZr7w+F8S9ziyw= -github.com/AlecAivazis/survey/v2 v2.3.6/go.mod h1:4AuI9b7RjAR+G7v9+C4YSlX/YL3K3cWNXgWXOhllqvI= +github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ= +github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= @@ -19,8 +19,8 @@ github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= @@ -37,8 +37,8 @@ github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4Dvx github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= +github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kyokomi/emoji/v2 v2.2.12 h1:sSVA5nH9ebR3Zji1o31wu3yOwD1zKXQA2z0zUyeit60= @@ -48,8 +48,8 @@ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxec github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= @@ -67,21 +67,17 @@ github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/trivago/tgo v1.0.7 h1:uaWH/XIy9aWYWpjm2CU3RpcqZXmX2ysQ9/Go+d9gyrM= github.com/trivago/tgo v1.0.7/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkFnhc= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df h1:Y2l28Jr3vOEeYtxfVbMtVfOdAwuUqWaP9fvNKiBVeXY= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df/go.mod h1:pnyouUty/nBr/zm3GYwTIt+qFTLWbdjeLjZmJdzJOu8= -github.com/urfave/cli/v2 v2.25.0 h1:ykdZKuQey2zq0yin/l7JOm9Mh+pg72ngYMeB0ABn6q8= -github.com/urfave/cli/v2 v2.25.0/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/urfave/cli/v2 v2.27.1 h1:8xSQ6szndafKVRmfyeUMxkNUJQMjL1F2zmsZ+qHpfho= +github.com/urfave/cli/v2 v2.27.1/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -101,16 +97,15 @@ golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -131,6 +126,5 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 6a6993d52d69f1e3bb9c27ac61a4b6b247c24a3d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 26 Jan 2024 08:40:33 +0100 Subject: [PATCH 80/82] chore(deps): update actions/setup-go action to v5 (#264) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff8afb31..5bef41ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} @@ -51,7 +51,7 @@ jobs: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} @@ -69,7 +69,7 @@ jobs: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} @@ -91,7 +91,7 @@ jobs: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b3240e56..b945893c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,7 +19,7 @@ jobs: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec262420..a2fdfaad 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} From 65fd9c7cb65c6e4375a5e6f090a622d965b7cec9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 17:06:17 +0100 Subject: [PATCH 81/82] fix(deps): update all non-major dependencies (#269) * fix(deps): update all non-major dependencies * chore: bump go to v1.24 Signed-off-by: Manuel Vogel <8409778+mavogel@users.noreply.github.com> * fix: build and lint Signed-off-by: Manuel Vogel <8409778+mavogel@users.noreply.github.com> * fix: goreleaser Signed-off-by: Manuel Vogel <8409778+mavogel@users.noreply.github.com> * fix: goveralls Signed-off-by: Manuel Vogel <8409778+mavogel@users.noreply.github.com> * fix: remove deprecatad linter Signed-off-by: Manuel Vogel <8409778+mavogel@users.noreply.github.com> * fix: goveralls latest version install Signed-off-by: Manuel Vogel <8409778+mavogel@users.noreply.github.com> * fix: linter Signed-off-by: Manuel Vogel <8409778+mavogel@users.noreply.github.com> * fix: bump ci linter to v1.64.7 Signed-off-by: Manuel Vogel <8409778+mavogel@users.noreply.github.com> * fix: bump ci linter to v1.64.7 and fix issues Signed-off-by: Manuel Vogel <8409778+mavogel@users.noreply.github.com> * fix: remove version from linter yaml Signed-off-by: Manuel Vogel <8409778+mavogel@users.noreply.github.com> --------- Signed-off-by: Manuel Vogel <8409778+mavogel@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Manuel Vogel <8409778+mavogel@users.noreply.github.com> --- .github/workflows/ci.yml | 17 +++--- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 2 +- .golangci.yml | 64 +++-------------------- .goreleaser.yml | 4 +- README.md | 2 +- cmd/git-chglog/fs.go | 2 + go.mod | 41 +++++++-------- go.sum | 97 ++++++++++++++++++----------------- 9 files changed, 95 insertions(+), 136 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bef41ad..3e16b8c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,8 +12,8 @@ on: - "README.md" env: - GO_VERSION: "1.19" - GOLANGCI_VERSION: "v1.50.1" + GO_VERSION: "1.24" + GOLANGCI_VERSION: "v1.64.8" jobs: tests: @@ -33,9 +33,12 @@ jobs: run: make test - name: Install goveralls - run: go get github.com/mattn/goveralls - env: - GO111MODULE: off + run: | + go install github.com/mattn/goveralls@latest + echo $GOPATH + ls -lash $GOPATH + which goveralls + working-directory: /tmp - name: Send coverage run: goveralls -coverprofile=cover.out -service=github @@ -56,7 +59,7 @@ jobs: go-version: ${{ env.GO_VERSION }} - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: version: ${{ env.GOLANGCI_VERSION }} @@ -99,4 +102,4 @@ jobs: uses: goreleaser/goreleaser-action@v4 with: version: latest - args: release --clean --skip-publish --snapshot + args: release --clean --skip=publish --snapshot diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b945893c..f9386129 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,7 +6,7 @@ on: - master env: - GO_VERSION: "1.19" + GO_VERSION: "1.24" DOCKER_REGISTRY: "quay.io" jobs: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a2fdfaad..8236dec5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: - "*" env: - GO_VERSION: "1.19" + GO_VERSION: "1.24" DOCKER_REGISTRY: "quay.io" jobs: diff --git a/.golangci.yml b/.golangci.yml index c409770d..4e3fdd88 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,22 +1,10 @@ # https://golangci-lint.run/usage/configuration/ run: timeout: 10m - deadline: 5m tests: true -output: - format: tab - linters-settings: - govet: - # report about shadowed variables - check-shadowing: true - - golint: - # minimal confidence for issues, default is 0.8 - min-confidence: 0.8 - gofmt: # simplify code: gofmt with `-s` option, true by default simplify: true @@ -30,10 +18,6 @@ linters-settings: # minimal code complexity to report, 30 by default (but we recommend 10-20) min-complexity: 10 - maligned: - # print struct with more effective memory layout or not, false by default - suggest-new: true - dupl: # tokens count to trigger issue, 150 by default threshold: 100 @@ -48,13 +32,6 @@ linters-settings: # tab width in spaces. Default to 1. tab-width: 1 - unused: - # treat code as a program (not a library) and report unused exported identifiers; default is false. - # XXX: if you enable this setting, unused will report a lot of false-positives in text editors: - # if it's called for subdir of a project it can't find funcs usages. All text editor integrations - # with golangci-lint call it on a directory with the changed file. - check-exported: false - unparam: # Inspect exported functions, default is false. Set to true if no external program/library imports your code. # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: @@ -76,38 +53,24 @@ linters-settings: range-loops: true # Report preallocation suggestions on range loops, true by default for-loops: false # Report preallocation suggestions on for loops, false by default - gocritic: - # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks. - # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags". - enabled-tags: - - performance - - settings: # settings passed to gocritic - captLocal: # must be valid enabled check name - paramsOnly: true - rangeValCopy: - sizeThreshold: 32 - misspell: locale: US linters: enable: - - megacheck - - govet + - gosimple + - staticcheck + - unused - gocyclo - - gocritic - - interfacer - goconst - goimports - gofmt # We enable this as well as goimports for its simplify mode. - prealloc - - golint - unconvert - misspell - nakedret - dupl - - depguard + #- depguard TODO fix later presets: - bugs @@ -124,21 +87,9 @@ issues: - errcheck - dupl - gosec - - scopelint - unparam - - # These are performance optimisations rather than style issues per se. - # They warn when function arguments or range values copy a lot of memory - # rather than using a pointer. - - text: "(hugeParam|rangeValCopy):" - linters: - - gocritic - - # Independently from option `exclude` we use default exclude patterns, - # it can be disabled by this option. To list all - # excluded by default patterns execute `golangci-lint run --help`. - # Default value for this option is true. - exclude-use-default: false + - testifylint + - depguard # Show only new issues: if there are unstaged changes or untracked files, # only those changes are analyzed, else only changes in HEAD~ are analyzed. @@ -148,8 +99,5 @@ issues: # Default is false. new: false - # Maximum issues count per one linter. Set to 0 to disable. Default is 50. - max-per-linter: 0 - # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. max-same-issues: 0 diff --git a/.goreleaser.yml b/.goreleaser.yml index b0d7d922..9b4766ad 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,5 @@ +version: 2 + # This is an example .goreleaser.yml file with some sane defaults. # Make sure to check the documentation at http://goreleaser.com project_name: git-chglog @@ -44,7 +46,7 @@ dockers: - "quay.io/git-chglog/git-chglog:latest" brews: - - tap: + - repository: owner: git-chglog name: homebrew-git-chglog homepage: "https://godoc.org/github.com/git-chglog/git-chglog" diff --git a/README.md b/README.md index 3e767100..f053839f 100644 --- a/README.md +++ b/README.md @@ -686,7 +686,7 @@ We always welcome your contributions :clap: ## Development -1. Use Golang version `>= 1.19` +1. Use Golang version `>= 1.24` 1. Fork (https://github.com/git-chglog/git-chglog) :tada: 1. Create a feature branch :coffee: 1. Run test suite with the `$ make test` command and confirm that it passes :zap: diff --git a/cmd/git-chglog/fs.go b/cmd/git-chglog/fs.go index 9b091d89..f2c547b8 100644 --- a/cmd/git-chglog/fs.go +++ b/cmd/git-chglog/fs.go @@ -34,6 +34,7 @@ func (*osFileSystem) Exists(path string) bool { func (*osFileSystem) MkdirP(path string) error { if _, err := os.Stat(path); os.IsNotExist(err) { + //nolint:gosec return os.MkdirAll(path, os.ModePerm) } return nil @@ -45,5 +46,6 @@ func (*osFileSystem) Create(name string) (File, error) { } func (*osFileSystem) WriteFile(path string, content []byte) error { + //nolint:gosec return os.WriteFile(path, content, os.ModePerm) } diff --git a/go.mod b/go.mod index 5ee4682f..5c832ac9 100644 --- a/go.mod +++ b/go.mod @@ -1,47 +1,48 @@ module github.com/git-chglog/git-chglog -go 1.19 +go 1.24.1 require ( github.com/AlecAivazis/survey/v2 v2.3.7 - github.com/Masterminds/sprig/v3 v3.2.3 + github.com/Masterminds/sprig/v3 v3.3.0 github.com/andygrunwald/go-jira v1.16.0 github.com/coreos/go-semver v0.3.1 - github.com/fatih/color v1.16.0 + github.com/fatih/color v1.18.0 github.com/imdario/mergo v0.3.16 - github.com/kyokomi/emoji/v2 v2.2.12 - github.com/mattn/go-colorable v0.1.13 - github.com/stretchr/testify v1.8.4 + github.com/kyokomi/emoji/v2 v2.2.13 + github.com/mattn/go-colorable v0.1.14 + github.com/stretchr/testify v1.10.0 github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df - github.com/urfave/cli/v2 v2.27.1 + github.com/urfave/cli/v2 v2.27.6 gopkg.in/yaml.v2 v2.4.0 ) require ( + dario.cat/mergo v1.0.1 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.2.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/Masterminds/semver/v3 v3.3.0 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/golang-jwt/jwt/v4 v4.4.2 // indirect github.com/google/go-querystring v1.1.0 // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/huandu/xstrings v1.3.3 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/huandu/xstrings v1.5.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect - github.com/mitchellh/copystructure v1.0.0 // indirect - github.com/mitchellh/reflectwalk v1.0.0 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/shopspring/decimal v1.2.0 // indirect - github.com/spf13/cast v1.3.1 // indirect + github.com/shopspring/decimal v1.4.0 // indirect + github.com/spf13/cast v1.7.0 // indirect github.com/trivago/tgo v1.0.7 // indirect - github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - golang.org/x/crypto v0.3.0 // indirect - golang.org/x/sys v0.14.0 // indirect - golang.org/x/term v0.2.0 // indirect - golang.org/x/text v0.4.0 // indirect + github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index c0a2e4f2..56de2883 100644 --- a/go.sum +++ b/go.sum @@ -1,95 +1,101 @@ +dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= +dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ= github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= -github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= -github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= +github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0= +github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/Masterminds/sprig/v3 v3.3.0 h1:mQh0Yrg1XPo6vjYXgtf5OtijNAKJRNcTdOOGZe3tPhs= +github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSCzdgBfDb35Lz0= github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s= github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w= github.com/andygrunwald/go-jira v1.16.0 h1:PU7C7Fkk5L96JvPc6vDVIrd99vdPnYudHu4ju2c2ikQ= github.com/andygrunwald/go-jira v1.16.0/go.mod h1:UQH4IBVxIYWbgagc0LF/k9FRs9xjIiQ8hIcC6HfLwFU= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= +github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI= github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68= -github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= -github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI= +github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kyokomi/emoji/v2 v2.2.12 h1:sSVA5nH9ebR3Zji1o31wu3yOwD1zKXQA2z0zUyeit60= -github.com/kyokomi/emoji/v2 v2.2.12/go.mod h1:JUcn42DTdsXJo1SWanHh4HKDEyPaR5CqkmoirZZP9qE= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kyokomi/emoji/v2 v2.2.13 h1:GhTfQa67venUUvmleTNFnb+bi7S3aocF7ZCXU9fSO7U= +github.com/kyokomi/emoji/v2 v2.2.13/go.mod h1:JUcn42DTdsXJo1SWanHh4HKDEyPaR5CqkmoirZZP9qE= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= +github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/trivago/tgo v1.0.7 h1:uaWH/XIy9aWYWpjm2CU3RpcqZXmX2ysQ9/Go+d9gyrM= github.com/trivago/tgo v1.0.7/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkFnhc= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df h1:Y2l28Jr3vOEeYtxfVbMtVfOdAwuUqWaP9fvNKiBVeXY= github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df/go.mod h1:pnyouUty/nBr/zm3GYwTIt+qFTLWbdjeLjZmJdzJOu8= -github.com/urfave/cli/v2 v2.27.1 h1:8xSQ6szndafKVRmfyeUMxkNUJQMjL1F2zmsZ+qHpfho= -github.com/urfave/cli/v2 v2.27.1/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= +github.com/urfave/cli/v2 v2.27.6 h1:VdRdS98FNhKZ8/Az8B7MTyGQmpIr36O1EHybx/LaZ4g= +github.com/urfave/cli/v2 v2.27.6/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ= +github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= +github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.3.0 h1:a06MkbcxBrEFc0w0QIZWXrH/9cCX6KJyWbBOIwAn+7A= -golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -99,21 +105,20 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= @@ -121,8 +126,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 83fc0386adc397b29695b42722ede6a0d8b9ef13 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 28 Mar 2025 08:35:43 +0100 Subject: [PATCH 82/82] fix(deps): update module gopkg.in/yaml.v2 to v3 (#246) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 5c832ac9..bcf5f266 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,8 @@ require ( github.com/stretchr/testify v1.10.0 github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df github.com/urfave/cli/v2 v2.27.6 - gopkg.in/yaml.v2 v2.4.0 + gopkg.in/yaml.v2 v2.3.0 + gopkg.in/yaml.v3 v3.0.1 ) require ( @@ -44,5 +45,4 @@ require ( golang.org/x/sys v0.29.0 // indirect golang.org/x/term v0.23.0 // indirect golang.org/x/text v0.17.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 56de2883..737e6111 100644 --- a/go.sum +++ b/go.sum @@ -126,6 +126,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=