Skip to content

rubocops/cask/no_overrides: avoid nested depends_on macos: #20075

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

Merged
merged 1 commit into from
Jun 10, 2025

Conversation

EricFromCanada
Copy link
Member

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Prevent depends_on macos: from appearing inside on_system blocks, which ensures the generated cask info displayed at https://formulae.brew.sh/ is accurate.

Rylan12
Rylan12 previously approved these changes Jun 10, 2025
Copy link
Member

@Rylan12 Rylan12 left a comment

Choose a reason for hiding this comment

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

Makes sense to me

Edit: actually, does this still allow different depends_on macos: values to be used for intel and arm? I could see that being useful

@Rylan12 Rylan12 dismissed their stale review June 10, 2025 19:04

See previous question

@EricFromCanada
Copy link
Member Author

I've been revising casks that use that pattern because it leads to inaccurate brew info --cask --json=v2 --variations output, which affects formulae.brew.sh. E.g. in Homebrew/homebrew-cask#213405, the cask originally had:

  on_arm do
    depends_on macos: ">= :sonoma"
  end
  on_intel do
    depends_on macos: ">= :monterey"
  end

The ARM runner that runs generate-cask-api would correctly see that it requires Sonoma on ARM, but it'd miss the Intel requirement, so it'd generate variations for all Intel OS versions instead of just >= 12.x. As of Homebrew/homebrew-cask#215694 no core casks use this pattern.

Copy link
Member

@p-linnane p-linnane left a comment

Choose a reason for hiding this comment

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

Makes sense to me!

@EricFromCanada EricFromCanada added this pull request to the merge queue Jun 10, 2025
Merged via the queue into master with commit 721def3 Jun 10, 2025
33 checks passed
@EricFromCanada EricFromCanada deleted the no-nested-depends_on branch June 10, 2025 20:59
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.

3 participants