Skip to content

Add missing on_<system> stanzas to cask stanza order - #23321

Merged
MikeMcQuaid merged 5 commits into
Homebrew:mainfrom
AlternateRT:cask-missing-stanza-order
Jul 29, 2026
Merged

Add missing on_<system> stanzas to cask stanza order#23321
MikeMcQuaid merged 5 commits into
Homebrew:mainfrom
AlternateRT:cask-missing-stanza-order

Conversation

@AlternateRT

@AlternateRT AlternateRT commented Jul 26, 2026

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?

  • AI was used to generate or assist with generating this PR.

Adds on_macos and on_linux to ON_SYSTEM_METHODS_STANZA_ORDER so that they also follow the pattern that was already established with older on_<system> blocks. Furthermore, this also ensures that the stanza order is enforced inside them - before this PR, this did not happen.

Adjusts the cask AST so that on_system_conditional is correctly grouped with the arch, on_arch_conditional, and os stanzas.

And finally, this re-enables the cask rubocops that were momentarily disabled to allow these migrations to occur.

@AlternateRT
AlternateRT force-pushed the cask-missing-stanza-order branch from 946e9b3 to e890499 Compare July 26, 2026 22:06
@MikeMcQuaid

Copy link
Copy Markdown
Member

Thanks @AlternateRT! Would need fixed in homebrew/cask before this can get merged.

@AlternateRT
AlternateRT force-pushed the cask-missing-stanza-order branch 2 times, most recently from d588728 to 35be9f1 Compare July 27, 2026 08:18
@AlternateRT

AlternateRT commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

@MikeMcQuaid I'd be happy to fix them, though how would one go about doing that?

Without this PR, some of these orderings are currently considered style violations. Take the following generate_completions_from_executable from the 1password-cli cask.

If I attempt to fix this without this PR, wouldn't the CI on homebrew/cask fail with the following?

Taps/homebrew/homebrew-cask/Casks/1/1password-cli.rb:30:1: C: [Corrected] Cask/StanzaGrouping: stanza groups should be separated by a single empty line
  generate_completions_from_executable "op", "completion"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1 file inspected, 1 offense detected, 1 offense corrected

@AlternateRT
AlternateRT force-pushed the cask-missing-stanza-order branch from 3cf40d8 to 35a7113 Compare July 27, 2026 11:31
@MikeMcQuaid

Copy link
Copy Markdown
Member

@MikeMcQuaid I'd be happy to fix them, though how would one go about doing that?

@AlternateRT open a PR in homebrew/cask with the fixes: one commit per cask changed in format <cask_token>: <summary>

If I attempt to fix this without this PR, wouldn't the CI on homebrew/cask fail with the following?

The CI on this repo should make it impossible to merge something and accidentally break homebrew/cask PR. That's why the tap_syntax job is currently failing: merging this as-is would break homebrew/cask.

If you create the proposed PR above: it should be mergeable on homebrew/cask before this PR is merged and then you can merge this.

Make sense?

Thanks for the work here!

@AlternateRT

Copy link
Copy Markdown
Contributor Author

If you create the proposed PR above: it should be mergeable on homebrew/cask before this PR is merged and then you can merge this.

Make sense?

@MikeMcQuaid Thank you for the guidance 😄

I'll get right to it now!

@krehel

krehel commented Jul 27, 2026

Copy link
Copy Markdown
Member

Thanks so much for this @AlternateRT - I've had on my list to make some changes here since on_linux wasn't enforcing stanza order very well. ❤️

@AlternateRT

Copy link
Copy Markdown
Contributor Author

@AlternateRT

Copy link
Copy Markdown
Contributor Author

@AlternateRT

Copy link
Copy Markdown
Contributor Author

@AlternateRT

Copy link
Copy Markdown
Contributor Author

If I attempt to fix this without this PR, wouldn't the CI on homebrew/cask fail with the following?

Taps/homebrew/homebrew-cask/Casks/1/1password-cli.rb:30:1: C: [Corrected] Cask/StanzaGrouping: stanza groups should be separated by a single empty line
  generate_completions_from_executable "op", "completion"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1 file inspected, 1 offense detected, 1 offense corrected

As I feared, the PRs in homebrew/cask are failing because these groupings are not valid with the styling from main.

@MikeMcQuaid

Copy link
Copy Markdown
Member

As I feared, the PRs in homebrew/cask are failing because these groupings are not valid with the styling from main.

@AlternateRT Need to figure out a way to merge one before the other then I think. It may involve something like adding but disabling by default a new or existing rule here before merge and splitting this PR into two.

@AlternateRT

Copy link
Copy Markdown
Contributor Author

PR to group on_system_conditional after os stanza: #23339

- Handle `on_system_conditional` stanzas correctly, which should allow
  it to be grouped with `arch`, and `on_arch_conditional`, and `os`
- Always require `generate_completions_from_executable` to be grouped
  with other artifact stanzas
Also adds missing info for conditional statements section
@AlternateRT AlternateRT changed the title Add missing stanzas to cask stanza order Add missing on_<system> stanzas to cask stanza order Jul 28, 2026
@AlternateRT
AlternateRT force-pushed the cask-missing-stanza-order branch from 35a7113 to bcf3453 Compare July 28, 2026 19:50
@AlternateRT
AlternateRT marked this pull request as ready for review July 28, 2026 19:50

@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 added this pull request to the merge queue Jul 29, 2026
Merged via the queue into Homebrew:main with commit a0078af Jul 29, 2026
43 checks passed
@AlternateRT
AlternateRT deleted the cask-missing-stanza-order branch July 29, 2026 07:50
@fxcoudert

Copy link
Copy Markdown
Member

This triggered a systematic tap-syntax failure on casks: https://github.com/Homebrew/homebrew-cask/actions/runs/30438103281/job/90530829495?pr=277889

I don't know if this is a false positive of the audit, or one cask that somehow wasn't fixed prior to merging this (and if so, why it didn't trigger in CI here).

@fxcoudert

Copy link
Copy Markdown
Member

OK it's already fixed by Homebrew/homebrew-cask@01ce7eb thanks @MikeMcQuaid

@AlternateRT

AlternateRT commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

FYI, the following PRs will result in more tap-sytax failures if they are merged as-is:


Looking at the dates, it seems like this is what happened:

  1. At 21:49 (GMT+2) - the day before - various: group/order missing stanzas, part 3 homebrew-cask#277548 was merged.
  2. At 22:10 (GMT+2) - the day before - all the audits for this PR were successfully passed.
  3. At 22:25 (GMT+2) - the day before - all the audits for affine: add Linux AppImage homebrew-cask#277513 were successfully passed before this was merged.
  4. At 9:33 (GMT+2), this PR was approved and added to the merge queue.
  5. At 9:42 (GMT+2), affine: add Linux AppImage homebrew-cask#277513 was approved and added to the merge queue before this was merged.
  6. At 9:48 (GMT+2), affine: add Linux AppImage homebrew-cask#277513 was merged.
  7. At 9:50 (GMT+2), this PR was merged.

@MikeMcQuaid

Copy link
Copy Markdown
Member

Thanks @AlternateRT. Looks like these are now both missing required jobs so should be safe.

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.

4 participants