Add on_system to and reorder component order cop

This commit is contained in:
Rylan Polster 2022-07-11 01:51:18 -04:00
parent 423aac0d61
commit a4327521d5
No known key found for this signature in database
GPG Key ID: 46A744940CFF4D64
2 changed files with 5 additions and 1 deletions

View File

@ -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 }],

View File

@ -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