diff --git a/Library/Homebrew/ast_constants.rb b/Library/Homebrew/ast_constants.rb index 1de605374d..7622f0a2d3 100644 --- a/Library/Homebrew/ast_constants.rb +++ b/Library/Homebrew/ast_constants.rb @@ -29,6 +29,10 @@ FORMULA_COMPONENT_PRECEDENCE_LIST = [ [{ name: :depends_on, type: :method_call }], [{ name: :uses_from_macos, type: :method_call }], [{ name: :on_macos, type: :block_call }], + *MacOSVersions::SYMBOLS.keys.map do |os_name| + [{ name: :"on_#{os_name}", type: :block_call }] + end, + [{ name: :on_system, type: :block_call }], [{ name: :on_linux, type: :block_call }], [{ name: :on_arm, type: :block_call }], [{ name: :on_intel, type: :block_call }], diff --git a/Library/Homebrew/rubocops/components_order.rb b/Library/Homebrew/rubocops/components_order.rb index 094ef0bfce..6a5a789325 100644 --- a/Library/Homebrew/rubocops/components_order.rb +++ b/Library/Homebrew/rubocops/components_order.rb @@ -15,7 +15,7 @@ module RuboCop extend AutoCorrector def on_system_methods - @on_system_methods ||= [:intel, :arm, :macos, :linux, *MacOSVersions::SYMBOLS.keys].map do |m| + @on_system_methods ||= [:intel, :arm, :macos, :linux, :system, *MacOSVersions::SYMBOLS.keys].map do |m| :"on_#{m}" end end