Skip to content

Commit

Permalink
fix: brew style
Browse files Browse the repository at this point in the history
closes #3236

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 committed Aug 1, 2022
1 parent 2096b56 commit 588d8aa
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 71 deletions.
26 changes: 13 additions & 13 deletions internal/pipe/brew/template.go
Expand Up @@ -45,6 +45,19 @@ class {{ .Name }} < Formula
{{- if .License }}
license "{{ .License }}"
{{- end }}
{{- with .Dependencies }}
{{ range $index, $element := . }}
depends_on "{{ .Name }}"
{{- if .Type }} => :{{ .Type }}{{- end }}
{{- end }}
{{- end -}}
{{- with .Conflicts }}
{{ range $index, $element := . }}
conflicts_with "{{ . }}"
{{- end }}
{{- end }}
{{- if and (not .LinuxPackages) .MacOSPackages }}
depends_on :macos
{{- end }}
Expand Down Expand Up @@ -142,19 +155,6 @@ class {{ .Name }} < Formula
{{- end }}
{{- end }}
{{- with .Dependencies }}
{{ range $index, $element := . }}
depends_on "{{ .Name }}"
{{- if .Type }} => :{{ .Type }}{{- end }}
{{- end }}
{{- end -}}
{{- with .Conflicts }}
{{ range $index, $element := . }}
conflicts_with "{{ . }}"
{{- end }}
{{- end }}
{{- with .PostInstall }}
def post_install
Expand Down
8 changes: 4 additions & 4 deletions internal/pipe/brew/testdata/TestFullFormulae.rb.golden
Expand Up @@ -8,6 +8,10 @@ class Test < Formula
version "0.1.3"
license "MIT"

depends_on "gtk+"

conflicts_with "svn"

on_macos do
if Hardware::CPU.intel?
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_x86_64.tar.gz"
Expand Down Expand Up @@ -59,10 +63,6 @@ class Test < Formula
sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c68"
end

depends_on "gtk+"

conflicts_with "svn"

def post_install
system "touch", "/tmp/foo"
system "echo", "done"
Expand Down
12 changes: 6 additions & 6 deletions internal/pipe/brew/testdata/TestFullPipe/custom_block.rb.golden
Expand Up @@ -6,6 +6,12 @@ class CustomBlock < Formula
desc "A 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"

conflicts_with "gtk+"
conflicts_with "qt"
depends_on :macos

on_macos do
Expand All @@ -29,12 +35,6 @@ class CustomBlock < Formula

head "https://github.com/caarlos0/test.git"

depends_on "zsh" => :optional
depends_on "bash"

conflicts_with "gtk+"
conflicts_with "qt"

def post_install
system "echo"
system "touch" "/tmp/hi"
Expand Down
Expand Up @@ -6,6 +6,12 @@ class CustomDownloadStrategy < Formula
desc "A 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"

conflicts_with "gtk+"
conflicts_with "qt"
depends_on :macos

on_macos do
Expand All @@ -27,12 +33,6 @@ 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"
Expand Down
Expand Up @@ -7,6 +7,12 @@ class CustomRequire < Formula
desc "A 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"

conflicts_with "gtk+"
conflicts_with "qt"
depends_on :macos

on_macos do
Expand All @@ -28,12 +34,6 @@ 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"
Expand Down
12 changes: 6 additions & 6 deletions internal/pipe/brew/testdata/TestFullPipe/default.rb.golden
Expand Up @@ -6,6 +6,12 @@ class Default < Formula
desc "A 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"

conflicts_with "gtk+"
conflicts_with "qt"
depends_on :macos

on_macos do
Expand All @@ -27,12 +33,6 @@ 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"
Expand Down
Expand Up @@ -6,6 +6,12 @@ class DefaultGitlab < Formula
desc "A 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"

conflicts_with "gtk+"
conflicts_with "qt"
depends_on :macos

on_macos do
Expand All @@ -27,12 +33,6 @@ 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"
Expand Down
Expand Up @@ -6,6 +6,12 @@ class ValidTapTemplates < Formula
desc "A run pipe test formula and FOO=templated"
homepage ""
version "1.0.1"

depends_on "zsh" => :optional
depends_on "bash"

conflicts_with "gtk+"
conflicts_with "qt"
depends_on :macos

on_macos do
Expand All @@ -27,12 +33,6 @@ 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"
Expand Down
Expand Up @@ -7,6 +7,12 @@ class MultipleArmv5 < Formula
homepage "https://github.com/goreleaser"
version "1.0.1"

depends_on "zsh"
depends_on "bash" => :recommended

conflicts_with "gtk+"
conflicts_with "qt"

on_macos do
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
Expand Down Expand Up @@ -45,12 +51,6 @@ 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
Expand Down
Expand Up @@ -7,6 +7,12 @@ class MultipleArmv6 < Formula
homepage "https://github.com/goreleaser"
version "1.0.1"

depends_on "zsh"
depends_on "bash" => :recommended

conflicts_with "gtk+"
conflicts_with "qt"

on_macos do
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
Expand Down Expand Up @@ -45,12 +51,6 @@ 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
Expand Down
Expand Up @@ -7,6 +7,12 @@ class MultipleArmv7 < Formula
homepage "https://github.com/goreleaser"
version "1.0.1"

depends_on "zsh"
depends_on "bash" => :recommended

conflicts_with "gtk+"
conflicts_with "qt"

on_macos do
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
Expand Down Expand Up @@ -45,12 +51,6 @@ 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
Expand Down

0 comments on commit 588d8aa

Please sign in to comment.