Include on_{system} blocks as stanzas in rubocop
				
					
				
			This commit is contained in:
		
							parent
							
								
									2415339124
								
							
						
					
					
						commit
						3f00893201
					
				@ -49,7 +49,7 @@ module RuboCop
 | 
			
		||||
          stanzas.sort do |s1, s2|
 | 
			
		||||
            i1 = stanza_order_index(s1)
 | 
			
		||||
            i2 = stanza_order_index(s2)
 | 
			
		||||
            if i1 == i2
 | 
			
		||||
            if i1 == i2 || i1.blank? || i2.blank?
 | 
			
		||||
              i1 = stanzas.index(s1)
 | 
			
		||||
              i2 = stanzas.index(s2)
 | 
			
		||||
            end
 | 
			
		||||
 | 
			
		||||
@ -55,6 +55,8 @@ module RuboCop
 | 
			
		||||
        end.freeze
 | 
			
		||||
 | 
			
		||||
      STANZA_ORDER = STANZA_GROUPS.flatten.freeze
 | 
			
		||||
 | 
			
		||||
      ON_SYSTEM_METHODS = [:arm, :intel, *MacOSVersions::SYMBOLS.keys].map { |option| :"on_#{option}" }.freeze
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@ -19,8 +19,10 @@ module RuboCop
 | 
			
		||||
 | 
			
		||||
      def stanza?
 | 
			
		||||
        return true if arch_variable?
 | 
			
		||||
        return false if !send_type? && !block_type?
 | 
			
		||||
        return true if ON_SYSTEM_METHODS.include?(method_name)
 | 
			
		||||
 | 
			
		||||
        (send_type? || block_type?) && STANZA_ORDER.include?(method_name)
 | 
			
		||||
        STANZA_ORDER.include?(method_name)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      def heredoc?
 | 
			
		||||
 | 
			
		||||
@ -9,7 +9,6 @@ cask "multiple-versions" do
 | 
			
		||||
    version "1.2.0"
 | 
			
		||||
    sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b"
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  on_catalina :or_older do
 | 
			
		||||
    version "1.0.0"
 | 
			
		||||
    sha256 "1866dfa833b123bb8fe7fa7185ebf24d28d300d0643d75798bc23730af734216"
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user