From d6306059d2bb935afd3cf2a7e91285a5bda69efe Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sat, 6 Aug 2022 19:00:16 -0300 Subject: [PATCH] fix: brew style (#3274) * fix: brew style closes #3236 Signed-off-by: Carlos A Becker * fix: more fixes Signed-off-by: Carlos A Becker * fix: more fixes Signed-off-by: Carlos A Becker --- internal/pipe/brew/brew_test.go | 42 ++++++++++------- internal/pipe/brew/template.go | 46 ++++++++++--------- .../brew/testdata/TestFullFormulae.rb.golden | 30 ++++++------ .../TestFullFormulaeMacOSOnly.rb.golden | 2 +- .../TestFullPipe/custom_block.rb.golden | 32 +++++++------ .../custom_download_strategy.rb.golden | 30 ++++++------ .../TestFullPipe/custom_require.rb.golden | 30 ++++++------ .../testdata/TestFullPipe/default.rb.golden | 28 +++++------ .../TestFullPipe/default_gitlab.rb.golden | 28 +++++------ .../valid_tap_templates.rb.golden | 28 +++++------ .../TestRunPipeBinaryRelease.rb.golden | 4 +- .../v1.rb.golden | 5 +- .../v2.rb.golden | 5 +- .../v3.rb.golden | 5 +- .../v4.rb.golden | 5 +- .../multiple_armv5.rb.golden | 26 ++++++----- .../multiple_armv6.rb.golden | 26 ++++++----- .../multiple_armv7.rb.golden | 26 ++++++----- .../TestRunPipeNameTemplate.rb.golden | 5 +- .../TestRunPipeUniversalBinary.rb.golden | 4 +- ...nPipeUniversalBinaryNotReplacing.rb.golden | 4 +- 21 files changed, 228 insertions(+), 183 deletions(-) diff --git a/internal/pipe/brew/brew_test.go b/internal/pipe/brew/brew_test.go index 62d6529d4b2..5ceb02948bd 100644 --- a/internal/pipe/brew/brew_test.go +++ b/internal/pipe/brew/brew_test.go @@ -75,7 +75,7 @@ var defaultTemplateData = templateData{ }, { DownloadURL: "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_arm64.tar.gz", - SHA256: "1633f61598ab0791e213135923624eb342196b349490sadasdsadsadasdasdsd", + SHA256: "1df5fdc2bad4ed4c28fbdc77b6c542988c0dc0e2ae34e0dc912bbb1c66646c58", OS: "darwin", Arch: "arm64", Install: []string{`bin.install "test"`}, @@ -103,9 +103,9 @@ func TestFullFormulae(t *testing.T) { data.Dependencies = []config.HomebrewDependency{{Name: "gtk+"}} data.Conflicts = []string{"svn"} data.Plist = "it works" - data.PostInstall = []string{`system "touch", "/tmp/foo"`, `system "echo", "done"`} + data.PostInstall = []string{`touch "/tmp/foo"`, `system "echo", "done"`} data.CustomBlock = []string{"devel do", ` url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_x86_64.tar.gz"`, ` sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c68"`, "end"} - data.Tests = []string{`system "#{bin}/{{.ProjectName}} -version"`} + data.Tests = []string{`system "#{bin}/{{.ProjectName}}", "-version"`} formulae, err := doBuildFormula(context.New(config.Project{ ProjectName: "foo", }), data) @@ -145,8 +145,8 @@ func TestFormulaeSimple(t *testing.T) { } func TestSplit(t *testing.T) { - parts := split("system \"true\"\nsystem \"#{bin}/foo -h\"") - require.Equal(t, []string{"system \"true\"", "system \"#{bin}/foo -h\""}, parts) + parts := split("system \"true\"\nsystem \"#{bin}/foo\", \"-h\"") + require.Equal(t, []string{"system \"true\"", "system \"#{bin}/foo\", \"-h\""}, parts) parts = split("") require.Equal(t, []string{}, parts) parts = split("\n ") @@ -268,14 +268,14 @@ func TestFullPipe(t *testing.T) { IDs: []string{ "foo", }, - Description: "A run pipe test formula and FOO={{ .Env.FOO }}", + Description: "Run pipe test formula and FOO={{ .Env.FOO }}", Caveats: "don't do this {{ .ProjectName }}", - Test: "system \"true\"\nsystem \"#{bin}/foo -h\"", + Test: "system \"true\"\nsystem \"#{bin}/foo\", \"-h\"", Plist: `whatever`, Dependencies: []config.HomebrewDependency{{Name: "zsh", Type: "optional"}, {Name: "bash"}}, Conflicts: []string{"gtk+", "qt"}, Service: "run foo/bar\nkeep_alive true", - PostInstall: "system \"echo\"\nsystem \"touch\" \"/tmp/hi\"", + PostInstall: "system \"echo\"\ntouch \"/tmp/hi\"", Install: `bin.install "{{ .ProjectName }}"`, Goamd64: "v1", }, @@ -353,8 +353,11 @@ func TestRunPipeNameTemplate(t *testing.T) { ProjectName: "foo", Brews: []config.Homebrew{ { - Name: "foo_{{ .Env.FOO_BAR }}", - Goamd64: "v1", + Name: "foo_{{ .Env.FOO_BAR }}", + Description: "Foo bar", + Homepage: "https://goreleaser.com", + Goamd64: "v1", + Install: `bin.install "foo"`, Tap: config.RepoRef{ Owner: "foo", Name: "bar", @@ -524,12 +527,13 @@ func TestRunPipeForMultipleAmd64Versions(t *testing.T) { Brews: []config.Homebrew{ { Name: name, - Description: "A run pipe test formula", + Description: "Run pipe test formula", Tap: config.RepoRef{ Owner: "test", Name: "test", }, Homepage: "https://github.com/goreleaser", + Install: `bin.install "foo"`, }, }, GitHubURLs: config.GitHubURLs{ @@ -648,9 +652,9 @@ func TestRunPipeForMultipleArmVersions(t *testing.T) { Brews: []config.Homebrew{ { Name: name, - Description: "A run pipe test formula and FOO={{ .Env.FOO }}", + Description: "Run pipe test formula and FOO={{ .Env.FOO }}", Caveats: "don't do this {{ .ProjectName }}", - Test: "system \"true\"\nsystem \"#{bin}/foo -h\"", + Test: "system \"true\"\nsystem \"#{bin}/foo\", \"-h\"", Plist: `whatever`, Dependencies: []config.HomebrewDependency{{Name: "zsh"}, {Name: "bash", Type: "recommended"}}, Conflicts: []string{"gtk+", "qt"}, @@ -921,7 +925,9 @@ func TestRunPipeBinaryRelease(t *testing.T) { ProjectName: "foo", Brews: []config.Homebrew{ { - Name: "foo", + Name: "foo", + Homepage: "https://goreleaser.com", + Description: "Fake desc", Tap: config.RepoRef{ Owner: "foo", Name: "bar", @@ -1159,7 +1165,9 @@ func TestRunPipeUniversalBinary(t *testing.T) { ProjectName: "unibin", Brews: []config.Homebrew{ { - Name: "unibin", + Name: "unibin", + Homepage: "https://goreleaser.com", + Description: "Fake desc", Tap: config.RepoRef{ Owner: "unibin", Name: "bar", @@ -1215,7 +1223,9 @@ func TestRunPipeUniversalBinaryNotReplacing(t *testing.T) { ProjectName: "unibin", Brews: []config.Homebrew{ { - Name: "unibin", + Name: "unibin", + Homepage: "https://goreleaser.com", + Description: "Fake desc", Tap: config.RepoRef{ Owner: "unibin", Name: "bar", diff --git a/internal/pipe/brew/template.go b/internal/pipe/brew/template.go index c66c26f7df7..d78bba6a062 100644 --- a/internal/pipe/brew/template.go +++ b/internal/pipe/brew/template.go @@ -45,6 +45,13 @@ class {{ .Name }} < Formula {{- if .License }} license "{{ .License }}" {{- end }} + {{- with .Dependencies }} + {{ range $index, $element := . }} + depends_on "{{ .Name }}" + {{- if .Type }} => :{{ .Type }}{{- end }} + {{- end }} + {{- end -}} + {{- if and (not .LinuxPackages) .MacOSPackages }} depends_on :macos {{- end }} @@ -58,7 +65,7 @@ class {{ .Name }} < Formula {{- range $element := .MacOSPackages }} {{- if eq $element.Arch "all" }} url "{{ $element.DownloadURL }}" - {{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }} + {{- if .DownloadStrategy }}, using: {{ .DownloadStrategy }}{{- end }} sha256 "{{ $element.SHA256 }}" def install @@ -68,7 +75,7 @@ class {{ .Name }} < Formula end {{- else if $.HasOnlyAmd64MacOsPkg }} url "{{ $element.DownloadURL }}" - {{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }} + {{- if .DownloadStrategy }}, using: {{ .DownloadStrategy }}{{- end }} sha256 "{{ $element.SHA256 }}" def install @@ -94,7 +101,7 @@ class {{ .Name }} < Formula if Hardware::CPU.arm? {{- end}} url "{{ $element.DownloadURL }}" - {{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }} + {{- if .DownloadStrategy }}, using: {{ .DownloadStrategy }}{{- end }} sha256 "{{ $element.SHA256 }}" def install @@ -123,7 +130,7 @@ class {{ .Name }} < Formula if Hardware::CPU.arm? && Hardware::CPU.is_64_bit? {{- end }} url "{{ $element.DownloadURL }}" - {{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }} + {{- if .DownloadStrategy }}, using: {{ .DownloadStrategy }}{{- end }} sha256 "{{ $element.SHA256 }}" def install @@ -136,22 +143,15 @@ class {{ .Name }} < Formula end {{- end }} - {{- with .CustomBlock }} + {{- with .Conflicts }} {{ range $index, $element := . }} - {{ . }} + conflicts_with "{{ . }}" {{- end }} {{- end }} - {{- with .Dependencies }} - {{ range $index, $element := . }} - depends_on "{{ .Name }}" - {{- if .Type }} => :{{ .Type }}{{- end }} - {{- end }} - {{- end -}} - - {{- with .Conflicts }} + {{- with .CustomBlock }} {{ range $index, $element := . }} - conflicts_with "{{ . }}" + {{ . }} {{- end }} {{- end }} @@ -166,21 +166,23 @@ class {{ .Name }} < Formula {{- with .Caveats }} - def caveats; <<~EOS + def caveats + <<~EOS {{- range $index, $element := . }} - {{ . -}} + {{ . -}} {{- end }} - EOS + EOS end {{- end -}} {{- with .Plist }} - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - {{ . }} - EOS + def plist + <<~EOS + {{ . }} + EOS end {{- end -}} diff --git a/internal/pipe/brew/testdata/TestFullFormulae.rb.golden b/internal/pipe/brew/testdata/TestFullFormulae.rb.golden index 3c995e35e87..90bdb960dc5 100644 --- a/internal/pipe/brew/testdata/TestFullFormulae.rb.golden +++ b/internal/pipe/brew/testdata/TestFullFormulae.rb.golden @@ -8,6 +8,8 @@ class Test < Formula version "0.1.3" license "MIT" + depends_on "gtk+" + on_macos do if Hardware::CPU.intel? url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_x86_64.tar.gz" @@ -19,7 +21,7 @@ class Test < Formula end if Hardware::CPU.arm? url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_arm64.tar.gz" - sha256 "1633f61598ab0791e213135923624eb342196b349490sadasdsadsadasdasdsd" + sha256 "1df5fdc2bad4ed4c28fbdc77b6c542988c0dc0e2ae34e0dc912bbb1c66646c58" def install bin.install "test" @@ -54,33 +56,33 @@ class Test < Formula end end + conflicts_with "svn" + devel do url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_x86_64.tar.gz" sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c68" end - depends_on "gtk+" - - conflicts_with "svn" - def post_install - system "touch", "/tmp/foo" + touch "/tmp/foo" system "echo", "done" end - def caveats; <<~EOS - Here are some caveats - EOS + def caveats + <<~EOS + Here are some caveats + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - it works - EOS + def plist + <<~EOS + it works + EOS end test do - system "#{bin}/foo -version" + system "#{bin}/foo", "-version" end end diff --git a/internal/pipe/brew/testdata/TestFullFormulaeMacOSOnly.rb.golden b/internal/pipe/brew/testdata/TestFullFormulaeMacOSOnly.rb.golden index 942ec48535e..e5537ba074e 100644 --- a/internal/pipe/brew/testdata/TestFullFormulaeMacOSOnly.rb.golden +++ b/internal/pipe/brew/testdata/TestFullFormulaeMacOSOnly.rb.golden @@ -19,7 +19,7 @@ class Test < Formula end if Hardware::CPU.arm? url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_arm64.tar.gz" - sha256 "1633f61598ab0791e213135923624eb342196b349490sadasdsadsadasdasdsd" + sha256 "1df5fdc2bad4ed4c28fbdc77b6c542988c0dc0e2ae34e0dc912bbb1c66646c58" def install bin.install "test" diff --git a/internal/pipe/brew/testdata/TestFullPipe/custom_block.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/custom_block.rb.golden index 87289275dd7..0ead5913588 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/custom_block.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/custom_block.rb.golden @@ -3,9 +3,12 @@ # This file was generated by GoReleaser. DO NOT EDIT. class CustomBlock < Formula - desc "A run pipe test formula and FOO=foo_is_bar" + desc "Run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" + + depends_on "zsh" => :optional + depends_on "bash" depends_on :macos on_macos do @@ -27,29 +30,28 @@ class CustomBlock < Formula end end - head "https://github.com/caarlos0/test.git" - - depends_on "zsh" => :optional - depends_on "bash" - conflicts_with "gtk+" conflicts_with "qt" + head "https://github.com/caarlos0/test.git" + def post_install system "echo" - system "touch" "/tmp/hi" + touch "/tmp/hi" end - def caveats; <<~EOS - don't do this custom_block - EOS + def caveats + <<~EOS + don't do this custom_block + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end service do @@ -59,6 +61,6 @@ class CustomBlock < Formula test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestFullPipe/custom_download_strategy.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/custom_download_strategy.rb.golden index 450351e5844..b70ac164fd4 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/custom_download_strategy.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/custom_download_strategy.rb.golden @@ -3,13 +3,16 @@ # This file was generated by GoReleaser. DO NOT EDIT. class CustomDownloadStrategy < Formula - desc "A run pipe test formula and FOO=foo_is_bar" + desc "Run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" + + depends_on "zsh" => :optional + depends_on "bash" depends_on :macos on_macos do - url "https://dummyhost/download/v1.0.1/bin.tar.gz", :using => GitHubPrivateRepositoryReleaseDownloadStrategy + url "https://dummyhost/download/v1.0.1/bin.tar.gz", using: GitHubPrivateRepositoryReleaseDownloadStrategy sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install @@ -27,27 +30,26 @@ class CustomDownloadStrategy < Formula end end - depends_on "zsh" => :optional - depends_on "bash" - conflicts_with "gtk+" conflicts_with "qt" def post_install system "echo" - system "touch" "/tmp/hi" + touch "/tmp/hi" end - def caveats; <<~EOS - don't do this custom_download_strategy - EOS + def caveats + <<~EOS + don't do this custom_download_strategy + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end service do @@ -57,6 +59,6 @@ class CustomDownloadStrategy < Formula test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestFullPipe/custom_require.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/custom_require.rb.golden index baa5b40ebd3..8268f1cb7f1 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/custom_require.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/custom_require.rb.golden @@ -4,13 +4,16 @@ # This file was generated by GoReleaser. DO NOT EDIT. require_relative "custom_download_strategy" class CustomRequire < Formula - desc "A run pipe test formula and FOO=foo_is_bar" + desc "Run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" + + depends_on "zsh" => :optional + depends_on "bash" depends_on :macos on_macos do - url "https://dummyhost/download/v1.0.1/bin.tar.gz", :using => CustomDownloadStrategy + url "https://dummyhost/download/v1.0.1/bin.tar.gz", using: CustomDownloadStrategy sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install @@ -28,27 +31,26 @@ class CustomRequire < Formula end end - depends_on "zsh" => :optional - depends_on "bash" - conflicts_with "gtk+" conflicts_with "qt" def post_install system "echo" - system "touch" "/tmp/hi" + touch "/tmp/hi" end - def caveats; <<~EOS - don't do this custom_require - EOS + def caveats + <<~EOS + don't do this custom_require + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end service do @@ -58,6 +60,6 @@ class CustomRequire < Formula test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestFullPipe/default.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/default.rb.golden index 8501ec49a97..98000a4eee9 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/default.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/default.rb.golden @@ -3,9 +3,12 @@ # This file was generated by GoReleaser. DO NOT EDIT. class Default < Formula - desc "A run pipe test formula and FOO=foo_is_bar" + desc "Run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" + + depends_on "zsh" => :optional + depends_on "bash" depends_on :macos on_macos do @@ -27,27 +30,26 @@ class Default < Formula end end - depends_on "zsh" => :optional - depends_on "bash" - conflicts_with "gtk+" conflicts_with "qt" def post_install system "echo" - system "touch" "/tmp/hi" + touch "/tmp/hi" end - def caveats; <<~EOS - don't do this default - EOS + def caveats + <<~EOS + don't do this default + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end service do @@ -57,6 +59,6 @@ class Default < Formula test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestFullPipe/default_gitlab.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/default_gitlab.rb.golden index 64378d0a108..f3b8a28e4ea 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/default_gitlab.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/default_gitlab.rb.golden @@ -3,9 +3,12 @@ # This file was generated by GoReleaser. DO NOT EDIT. class DefaultGitlab < Formula - desc "A run pipe test formula and FOO=foo_is_bar" + desc "Run pipe test formula and FOO=foo_is_bar" homepage "https://gitlab.com/goreleaser" version "1.0.1" + + depends_on "zsh" => :optional + depends_on "bash" depends_on :macos on_macos do @@ -27,27 +30,26 @@ class DefaultGitlab < Formula end end - depends_on "zsh" => :optional - depends_on "bash" - conflicts_with "gtk+" conflicts_with "qt" def post_install system "echo" - system "touch" "/tmp/hi" + touch "/tmp/hi" end - def caveats; <<~EOS - don't do this default_gitlab - EOS + def caveats + <<~EOS + don't do this default_gitlab + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end service do @@ -57,6 +59,6 @@ class DefaultGitlab < Formula test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestFullPipe/valid_tap_templates.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/valid_tap_templates.rb.golden index 69dd9e0f8ce..787b5440aaf 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/valid_tap_templates.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/valid_tap_templates.rb.golden @@ -3,9 +3,12 @@ # This file was generated by GoReleaser. DO NOT EDIT. class ValidTapTemplates < Formula - desc "A run pipe test formula and FOO=templated" + desc "Run pipe test formula and FOO=templated" homepage "" version "1.0.1" + + depends_on "zsh" => :optional + depends_on "bash" depends_on :macos on_macos do @@ -27,27 +30,26 @@ class ValidTapTemplates < Formula end end - depends_on "zsh" => :optional - depends_on "bash" - conflicts_with "gtk+" conflicts_with "qt" def post_install system "echo" - system "touch" "/tmp/hi" + touch "/tmp/hi" end - def caveats; <<~EOS - don't do this valid_tap_templates - EOS + def caveats + <<~EOS + don't do this valid_tap_templates + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end service do @@ -57,6 +59,6 @@ class ValidTapTemplates < Formula test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestRunPipeBinaryRelease.rb.golden b/internal/pipe/brew/testdata/TestRunPipeBinaryRelease.rb.golden index c9e8520a35e..7d6d4e319e9 100644 --- a/internal/pipe/brew/testdata/TestRunPipeBinaryRelease.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeBinaryRelease.rb.golden @@ -3,8 +3,8 @@ # This file was generated by GoReleaser. DO NOT EDIT. class Foo < Formula - desc "" - homepage "" + desc "Fake desc" + homepage "https://goreleaser.com" version "1.2.1" depends_on :macos diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v1.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v1.rb.golden index 4740f9beb76..0f84661f49d 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v1.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v1.rb.golden @@ -3,7 +3,7 @@ # This file was generated by GoReleaser. DO NOT EDIT. class V1 < Formula - desc "A run pipe test formula" + desc "Run pipe test formula" homepage "https://github.com/goreleaser" version "1.0.1" @@ -13,6 +13,7 @@ class V1 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install "foo" end end end @@ -23,6 +24,7 @@ class V1 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install "foo" end end if Hardware::CPU.intel? @@ -30,6 +32,7 @@ class V1 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install "foo" end end end diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v2.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v2.rb.golden index 278d117186b..eb0a2b01df7 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v2.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v2.rb.golden @@ -3,7 +3,7 @@ # This file was generated by GoReleaser. DO NOT EDIT. class V2 < Formula - desc "A run pipe test formula" + desc "Run pipe test formula" homepage "https://github.com/goreleaser" version "1.0.1" @@ -13,6 +13,7 @@ class V2 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install "foo" end end end @@ -23,6 +24,7 @@ class V2 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install "foo" end end if Hardware::CPU.intel? @@ -30,6 +32,7 @@ class V2 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install "foo" end end end diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v3.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v3.rb.golden index ee702693ee3..da36695b082 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v3.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v3.rb.golden @@ -3,7 +3,7 @@ # This file was generated by GoReleaser. DO NOT EDIT. class V3 < Formula - desc "A run pipe test formula" + desc "Run pipe test formula" homepage "https://github.com/goreleaser" version "1.0.1" @@ -13,6 +13,7 @@ class V3 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install "foo" end end end @@ -23,6 +24,7 @@ class V3 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install "foo" end end if Hardware::CPU.intel? @@ -30,6 +32,7 @@ class V3 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install "foo" end end end diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v4.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v4.rb.golden index eb3d02c7200..eba025403e4 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v4.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v4.rb.golden @@ -3,7 +3,7 @@ # This file was generated by GoReleaser. DO NOT EDIT. class V4 < Formula - desc "A run pipe test formula" + desc "Run pipe test formula" homepage "https://github.com/goreleaser" version "1.0.1" @@ -13,6 +13,7 @@ class V4 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install "foo" end end end @@ -23,6 +24,7 @@ class V4 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install "foo" end end if Hardware::CPU.intel? @@ -30,6 +32,7 @@ class V4 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install "foo" end end end diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden index fe5df905a18..1cd003ca3d0 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden @@ -3,10 +3,13 @@ # This file was generated by GoReleaser. DO NOT EDIT. class MultipleArmv5 < Formula - desc "A run pipe test formula and FOO=foo_is_bar" + desc "Run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" + depends_on "zsh" + depends_on "bash" => :recommended + on_macos do url "https://dummyhost/download/v1.0.1/bin.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" @@ -45,26 +48,25 @@ class MultipleArmv5 < Formula end end - depends_on "zsh" - depends_on "bash" => :recommended - conflicts_with "gtk+" conflicts_with "qt" - def caveats; <<~EOS - don't do this multiple_armv5 - EOS + def caveats + <<~EOS + don't do this multiple_armv5 + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden index 92bcf99d70f..b60fe0a4b53 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden @@ -3,10 +3,13 @@ # This file was generated by GoReleaser. DO NOT EDIT. class MultipleArmv6 < Formula - desc "A run pipe test formula and FOO=foo_is_bar" + desc "Run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" + depends_on "zsh" + depends_on "bash" => :recommended + on_macos do url "https://dummyhost/download/v1.0.1/bin.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" @@ -45,26 +48,25 @@ class MultipleArmv6 < Formula end end - depends_on "zsh" - depends_on "bash" => :recommended - conflicts_with "gtk+" conflicts_with "qt" - def caveats; <<~EOS - don't do this multiple_armv6 - EOS + def caveats + <<~EOS + don't do this multiple_armv6 + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden index cbf3f0c5031..d9ba71317ee 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden @@ -3,10 +3,13 @@ # This file was generated by GoReleaser. DO NOT EDIT. class MultipleArmv7 < Formula - desc "A run pipe test formula and FOO=foo_is_bar" + desc "Run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" + depends_on "zsh" + depends_on "bash" => :recommended + on_macos do url "https://dummyhost/download/v1.0.1/bin.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" @@ -45,26 +48,25 @@ class MultipleArmv7 < Formula end end - depends_on "zsh" - depends_on "bash" => :recommended - conflicts_with "gtk+" conflicts_with "qt" - def caveats; <<~EOS - don't do this multiple_armv7 - EOS + def caveats + <<~EOS + don't do this multiple_armv7 + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden b/internal/pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden index 6199ba13517..8d43aaf7e02 100644 --- a/internal/pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden @@ -3,8 +3,8 @@ # This file was generated by GoReleaser. DO NOT EDIT. class FooIsBar < Formula - desc "" - homepage "" + desc "Foo bar" + homepage "https://goreleaser.com" version "1.0.1" depends_on :macos @@ -13,6 +13,7 @@ class FooIsBar < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install "foo" end if Hardware::CPU.arm? diff --git a/internal/pipe/brew/testdata/TestRunPipeUniversalBinary.rb.golden b/internal/pipe/brew/testdata/TestRunPipeUniversalBinary.rb.golden index cee06cb021b..3a599fc9073 100644 --- a/internal/pipe/brew/testdata/TestRunPipeUniversalBinary.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeUniversalBinary.rb.golden @@ -3,8 +3,8 @@ # This file was generated by GoReleaser. DO NOT EDIT. class Unibin < Formula - desc "" - homepage "" + desc "Fake desc" + homepage "https://goreleaser.com" version "1.0.1" depends_on :macos diff --git a/internal/pipe/brew/testdata/TestRunPipeUniversalBinaryNotReplacing.rb.golden b/internal/pipe/brew/testdata/TestRunPipeUniversalBinaryNotReplacing.rb.golden index 563173ca5ed..f17ace78f1d 100644 --- a/internal/pipe/brew/testdata/TestRunPipeUniversalBinaryNotReplacing.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeUniversalBinaryNotReplacing.rb.golden @@ -3,8 +3,8 @@ # This file was generated by GoReleaser. DO NOT EDIT. class Unibin < Formula - desc "" - homepage "" + desc "Fake desc" + homepage "https://goreleaser.com" version "1.0.1" depends_on :macos