remove new method and reset without TODO

This commit is contained in:
hyuraku 2022-06-10 22:24:20 +09:00
parent 7e31574c3f
commit 7a95219d2b
2 changed files with 1 additions and 15 deletions

View File

@ -292,8 +292,7 @@ module FormulaCellarChecks
dot_brew_formula = formula.prefix/".brew/#{formula.name}.rb"
return unless dot_brew_formula.exist?
require "utils/ast"
return unless Utils::AST::FormulaAST.new(dot_brew_formula.read).include_runtime_cpu_detection?
return unless dot_brew_formula.read.include? "ENV.runtime_cpu_detection"
# macOS `objdump` is a bit slow, so we prioritise llvm's `llvm-objdump` (~5.7x faster)
# or binutils' `objdump` (~1.8x faster) if they are installed.

View File

@ -190,19 +190,6 @@ module Utils
tree_rewriter.insert_after(preceding_expr, "\n#{stanza_text(name, value, indent: 2)}")
end
sig { returns(T::Boolean) }
def include_runtime_cpu_detection?
install_node = children.find do |child|
(child.is_a? RuboCop::AST::DefNode) && child.method_name == :install
end
return false if install_node.blank?
install_node.each_node.any? do |node|
node.send_type? && node.receiver&.const_name == "ENV" && node.method_name == :runtime_cpu_detection
end
end
private
sig { returns(String) }