Skip to content

Audit GoReleaser flags in staged resources - #24481

Merged
MikeMcQuaid merged 1 commit into
language-specific-formula-guidancefrom
audit-goreleaser-resources
Nov 4, 2026
Merged

MikeMcQuaid merged 1 commit into
language-specific-formula-guidancefrom
audit-goreleaser-resources

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member

Prevent resource builds from using the parent formula's metadata.


  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

Codex with GPT 6.1 Sol at Extra High effort, with local review and testing.


@MikeMcQuaid
MikeMcQuaid added this pull request to stack #24482 November 4, 2026 17:32
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Added a formula audit check for std_go_args calls that use GoReleaser linker flags in staged resources. The check distinguishes these calls from those in the main formula and does not flag default or custom linker flags, helping formula authors identify this specific configuration.

This change adds and loads the StdGoArgs formula audit cop. It reports eligible std_go_args calls in stage blocks when the final hash includes ldflags: :goreleaser. RSpec examples cover reporting and non-reporting cases.

Changes: Staged Go argument audit

Layer / File(s) Summary
Add and validate the staged argument audit
Library/Homebrew/rubocops/std_go_args.rb, Library/Homebrew/rubocops/all.rb, Library/Homebrew/test/rubocops/std_go_args_spec.rb
Adds and loads the StdGoArgs cop. The cop reports matching calls in stage blocks. Specs cover matching calls and cases that should not report offenses.
Merge Risk: Minimal · up to 20909

The new audit is active for named formula checks. No material merge risk was identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title names the main change: auditing GoReleaser flags in staged resources. The raw summary adds a cop, StdGoArgs, that reports std_go_args calls using ldflags: :goreleaser inside stage blocks. Th…
Description check Passed The description states the purpose: preventing resource builds from using the parent formula's metadata. This matches the new cop, which flags ldflags: :goreleaser in staged resources, and the specs t…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: auditing GoReleaser flags in staged resources. The raw summary adds a cop, StdGoArgs, that reports std_go_args calls using ldflags: :goreleaser inside stage blocks. The title is specific and matches the changeset.

Full details: Description check

Explanation

The description states the purpose: preventing resource builds from using the parent formula's metadata. This matches the new cop, which flags ldflags: :goreleaser in staged resources, and the specs that cover it. The description also includes checklist and AI-usage text, but the core purpose is related to the changeset.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5fb31cce-eaf5-4a43-b18f-246410f3aba8
Commits

Reviewing files that changed from the base of the PR and between 86326f4 and 20909e6.

Files selected for processing: 2
  • Library/Homebrew/rubocops/std_go_args.rb
  • Library/Homebrew/test/rubocops/std_go_args_spec.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dc056070-7e59-4243-83b3-5be685316d70
Commits

Reviewing files that changed from the base of the PR and between bd7f1a7 and 86326f4.

Files selected for processing: 3
  • Library/Homebrew/rubocops/all.rb
  • Library/Homebrew/rubocops/std_go_args.rb
  • Library/Homebrew/test/rubocops/std_go_args_spec.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

- Prevent resource builds from using the parent formula's metadata.
@MikeMcQuaid
MikeMcQuaid force-pushed the audit-goreleaser-resources branch from 86326f4 to 20909e6 Compare November 4, 2026 18:09
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit 8b0b7e4 Nov 4, 2026
55 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the audit-goreleaser-resources branch November 4, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ 换网址