Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew: depends_on should be put before on_macos #3236

Closed
3 tasks done
Gearheads opened this issue Jul 12, 2022 · 2 comments · Fixed by #3274
Closed
3 tasks done

brew: depends_on should be put before on_macos #3236

Gearheads opened this issue Jul 12, 2022 · 2 comments · Fixed by #3274
Assignees
Labels
bug Something isn't working

Comments

@Gearheads
Copy link

Gearheads commented Jul 12, 2022

What happened?

I expected the following command to complete successfully:

brew style fidelity/tap

However, it fails with the following error message:

Offenses:

/usr/local/Homebrew/Library/Taps/fidelity/homebrew-tap/Formula/kconnect.rb:48:3: C: [Correctable] depends_on (line 48) should be put before on_macos (line 10)
  depends_on "aws-iam-authenticator"
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1 file inspected, 1 offense detected, 1 offense auto-correctable

I believe the issue is because within the formulaTemplate it lists the Dependencies after the MacOS and Linux packages:

{{- with .Dependencies }}
{{ range $index, $element := . }}
depends_on "{{ .Name }}"
{{- if .Type }} => :{{ .Type }}{{- end }}
{{- end }}
{{- end -}}

How can we reproduce this?

This should be easily reproducible by having a formula template, *.rb, with the dependencies depend_on following the MacOS and or Linux packages, on_macos or on_linux.

An example formula can be found here: https://github.com/fidelity/homebrew-tap/blob/master/Formula/kconnect.rb

Error logs might be available here within the Github Action: https://github.com/fidelity/homebrew-tap/runs/7304043925?check_suite_focus=true

goreleaser version

% goreleaser --version
goreleaser version 1.9.2
commit: b869ea44b7e211c59d856307a5d308b594030218
built at: 2022-05-27T16:26:29Z
built by: goreleaser
goos: darwin
goarch: amd64
module version: v1.9.2, checksum: h1:ehLhZQ8KgbOvr0jBxhyy2VbekehFD0DJmsvqUz1c8To=

https://goreleaser.com

GoReleaser Check

  • goreleaser check shows no errors

Search

  • I did search for other open and closed issues before opening this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

Output for goreleaser check:

% goreleaser check
   • loading config file       file=.goreleaser.yml
   • checking config: 
   • config is valid 

I think this is an easy enough change, and I would be happy to help contribute. Please let me know if I can take on this issue, or if I am mistaken.

We can also see within the Homebrew Formula Cookbook, they appear to have the Dependencies defined early on in the formula:
https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md#grab-the-url

@Gearheads Gearheads added bug Something isn't working triage Issue pending triage by one of the maintainers labels Jul 12, 2022
@caarlos0 caarlos0 removed the triage Issue pending triage by one of the maintainers label Aug 1, 2022
caarlos0 added a commit that referenced this issue Aug 1, 2022
closes #3236

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
@caarlos0
Copy link
Member

caarlos0 commented Aug 1, 2022

check #3274

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants