Add and adjust cask rubocops to handle variables - #13681
Merged
Merged
Conversation
Contributor
|
Review period will end on 2022-08-11 at 22:38:24 UTC. |
MikeMcQuaid
approved these changes
Aug 11, 2022
Contributor
|
Review period ended. |
BrewTestBot
approved these changes
Aug 11, 2022
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes two rubocop changes to casks to enforce new rules about the
archandon_arch_conditionalDSLs that have now been added. This PR will not be able to be merged until the corresponding homebrew/cask PRs (Homebrew/homebrew-cask#129479 and Homebrew/homebrew-cask#129480) are merged.The first change in this PR is that use of the
archandon_arch_conditionalDSLs is now required instead ofarch = Hardware::CPU.intel? ? "intel" : "arm". There is an autocorrector which covers nearly all cases that we currently have in homebrew/cask (there are a few casks that did some weird things so I just fixed those manually in Homebrew/homebrew-cask#129480).The second change is in the way that the stanza order and stanza grouping logic works. Now, the
archDSL and allfoo = on_arch_conditionalcalls will be grouped together (witharchfirst) at the top of the file (note: other variable assignments that aren't arch-related are unaffected). Currently, this looks like this:I chose this because it most closely resembles the current way things are done so it minimizes the changes necessary. However, I'm open to other ordering if desired.