audit: flag re-added tap migrations
Re 411c217844 (commitcomment-11714539)
Closes Homebrew/homebrew#40806.
Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
			
			
This commit is contained in:
		
							parent
							
								
									6c4000d07a
								
							
						
					
					
						commit
						986a62ebe9
					
				@ -3,6 +3,7 @@ require "utils"
 | 
			
		||||
require "extend/ENV"
 | 
			
		||||
require "formula_cellar_checks"
 | 
			
		||||
require "official_taps"
 | 
			
		||||
require "tap_migrations"
 | 
			
		||||
require "cmd/search"
 | 
			
		||||
 | 
			
		||||
module Homebrew
 | 
			
		||||
@ -769,6 +770,20 @@ class FormulaAuditor
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def audit_reverse_migration
 | 
			
		||||
    # Only enforce for new formula being re-added to core
 | 
			
		||||
    return unless @strict
 | 
			
		||||
    return unless formula.core_formula?
 | 
			
		||||
 | 
			
		||||
    if TAP_MIGRATIONS.has_key?(formula.name)
 | 
			
		||||
      problem <<-EOS.undent
 | 
			
		||||
       #{formula.name} seems to be listed in tap_migrations.rb!
 | 
			
		||||
       Please remove #{formula.name} from present tap & tap_migrations.rb
 | 
			
		||||
       before submitting it to Homebrew/homebrew.
 | 
			
		||||
      EOS
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def audit_prefix_has_contents
 | 
			
		||||
    return unless formula.prefix.directory?
 | 
			
		||||
 | 
			
		||||
@ -823,6 +838,7 @@ class FormulaAuditor
 | 
			
		||||
    text.without_patch.split("\n").each_with_index { |line, lineno| audit_line(line, lineno+1) }
 | 
			
		||||
    audit_installed
 | 
			
		||||
    audit_prefix_has_contents
 | 
			
		||||
    audit_reverse_migration
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  private
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user