Skip to content

rubocops: adjust depends_on checks for Linux - #23453

Merged
MikeMcQuaid merged 1 commit into
Homebrew:mainfrom
AlternateRT:rubocop-adjust-os-depends-on
Aug 5, 2026
Merged

rubocops: adjust depends_on checks for Linux#23453
MikeMcQuaid merged 1 commit into
Homebrew:mainfrom
AlternateRT:rubocop-adjust-os-depends-on

Conversation

@AlternateRT

Copy link
Copy Markdown
Contributor

  • 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 Hyperfine benchmarks.
  • 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.

This adjusts the Homebrew/OSDependsOn cop in two ways:

The first change makes it so that declaring depends_on :linux is explicitly required for Linux-only casks as well (like in koreader).

The second change relaxes dependency declarations when using the os stanza; IMO, the current check does not make a lot of sense. Consider a cask that supports both macOS and Linux, and has a URL like this:

url "https://download.example.com/stable#{os}/#{version}/Foo.zip"

Where there is only a differentiator for the macOS artifact with the suffix -darwin.

With the current check, we would either need to declare an empty string for the :linux parameter like so:

os macos: "-darwin", linux: ""

Or replace the os stanza with an on_system_conditional call, which does not have this restriction.

os_suffix = on_system_conditional macos: "-darwin"

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@MikeMcQuaid
MikeMcQuaid enabled auto-merge August 5, 2026 20:00
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Aug 5, 2026
Merged via the queue into Homebrew:main with commit a084a7d Aug 5, 2026
43 checks passed
@AlternateRT
AlternateRT deleted the rubocop-adjust-os-depends-on branch August 5, 2026 20:44
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