Skip to content

Commit

Permalink
feat: remove deprecated brew config (#1313)
Browse files Browse the repository at this point in the history
* feat: remove deprecated brew config

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: wording

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: wording

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: defaults

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: defaults

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: defaults

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
  • Loading branch information
caarlos0 committed Jan 26, 2020
1 parent 3bfb363 commit 4797981
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
8 changes: 0 additions & 8 deletions internal/pipe/brew/brew.go
Expand Up @@ -7,14 +7,12 @@ import (
"io/ioutil"
"path"
"path/filepath"
"reflect"
"strings"
"text/template"

"github.com/apex/log"
"github.com/goreleaser/goreleaser/internal/artifact"
"github.com/goreleaser/goreleaser/internal/client"
"github.com/goreleaser/goreleaser/internal/deprecate"
"github.com/goreleaser/goreleaser/internal/pipe"
"github.com/goreleaser/goreleaser/internal/tmpl"
"github.com/goreleaser/goreleaser/pkg/config"
Expand Down Expand Up @@ -54,12 +52,6 @@ func (Pipe) Publish(ctx *context.Context) error {

// Default sets the pipe defaults
func (Pipe) Default(ctx *context.Context) error {
if len(ctx.Config.Brews) == 0 {
ctx.Config.Brews = append(ctx.Config.Brews, ctx.Config.Brew)
if !reflect.DeepEqual(ctx.Config.Brew, config.Homebrew{}) {
deprecate.Notice("brew")
}
}
for i := range ctx.Config.Brews {
var brew = &ctx.Config.Brews[i]
if brew.Install == "" {
Expand Down
4 changes: 3 additions & 1 deletion internal/pipe/brew/brew_test.go
Expand Up @@ -686,7 +686,9 @@ func TestDefault(t *testing.T) {
TokenType: context.TokenTypeGitHub,
Config: config.Project{
ProjectName: "myproject",
Brews: []config.Homebrew{},
Brews: []config.Homebrew{
{},
},
Builds: []config.Build{
{
Binary: "foo",
Expand Down
6 changes: 5 additions & 1 deletion internal/pipe/defaults/defaults_test.go
Expand Up @@ -36,7 +36,6 @@ func TestFillBasicData(t *testing.T) {
assert.Contains(t, ctx.Config.Builds[0].Goarch, "386")
assert.Contains(t, ctx.Config.Builds[0].Goarch, "amd64")
assert.Equal(t, "tar.gz", ctx.Config.Archives[0].Format)
assert.Contains(t, ctx.Config.Brews[0].Install, "bin.install \"goreleaser\"")
assert.Empty(t, ctx.Config.Dockers)
assert.Equal(t, "https://github.com", ctx.Config.GitHubURLs.Download)
assert.NotEmpty(t, ctx.Config.Archives[0].NameTemplate)
Expand Down Expand Up @@ -89,6 +88,11 @@ func TestFillPartial(t *testing.T) {
ImageTemplates: []string{"a/b"},
},
},
Brews: []config.Homebrew{
{
Description: "foo",
},
},
},
}
assert.NoError(t, Pipe{}.Run(ctx))
Expand Down
1 change: 0 additions & 1 deletion pkg/config/config.go
Expand Up @@ -345,7 +345,6 @@ type Project struct {
ProjectName string `yaml:"project_name,omitempty"`
Env []string `yaml:",omitempty"`
Release Release `yaml:",omitempty"`
Brew Homebrew `yaml:",omitempty"` // TODO: remove this
Brews []Homebrew `yaml:",omitempty"`
Scoop Scoop `yaml:",omitempty"`
Builds []Build `yaml:",omitempty"`
Expand Down
9 changes: 4 additions & 5 deletions www/content/deprecations.md
Expand Up @@ -129,10 +129,13 @@ signs:
# etc
```

## Expired deprecation notices

The following options were deprecated for ~6 months and are now fully removed.

### brew

> since 2019-06-09
> since 2019-06-09, removed 2020-01-26
Brew was deprecated in favor of its plural form.

Expand All @@ -151,10 +154,6 @@ brews:
# etc
```

## Expired deprecation notices

The following options were deprecated for ~6 months and are now fully removed.

### s3

> since 2019-06-09, removed 2020-01-07
Expand Down

0 comments on commit 4797981

Please sign in to comment.