From 7a8dd36003f66faec60cf6049a5ff0c33eb0158f Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Fri, 27 Nov 2020 12:36:30 -0500 Subject: [PATCH] Migrate BINARY_BOOTSTRAP_FORMULA_URLS_ALLOWLIST --- Library/Homebrew/rubocops/urls.rb | 28 +-------------------- Library/Homebrew/test/rubocops/urls_spec.rb | 2 -- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/Library/Homebrew/rubocops/urls.rb b/Library/Homebrew/rubocops/urls.rb index 62e347666b..0e08a4897d 100644 --- a/Library/Homebrew/rubocops/urls.rb +++ b/Library/Homebrew/rubocops/urls.rb @@ -25,32 +25,6 @@ module RuboCop https://github.com/vifm/vifm/releases/download/v0.11/vifm-osx-0.11.tar.bz2 ].freeze - # These are formulae that, sadly, require an upstream binary to bootstrap. - BINARY_BOOTSTRAP_FORMULA_URLS_ALLOWLIST = %w[ - clozure-cl - crystal - fpc - ghc - ghc@8.6 - ghc@8.8 - go - go@1.9 - go@1.10 - go@1.11 - go@1.12 - go@1.13 - go@1.14 - haskell-stack - ldc - mlton - openjdk - openjdk@11 - openjdk@8 - pypy - sbcl - rust - ].freeze - def audit_formula(_node, _class_node, _parent_class_node, body_node) urls = find_every_func_call_by_name(body_node, :url) mirrors = find_every_func_call_by_name(body_node, :mirror) @@ -282,7 +256,7 @@ module RuboCop next if @formula_name.include?(match.to_s.downcase) next if url.match?(/.(patch|diff)(\?full_index=1)?$/) next if NOT_A_BINARY_URL_PREFIX_ALLOWLIST.any? { |prefix| url.start_with?(prefix) } - next if BINARY_BOOTSTRAP_FORMULA_URLS_ALLOWLIST.include?(@formula_name) + next if tap_style_exception? :binary_bootstrap_formula_urls_allowlist problem "#{url} looks like a binary package, not a source archive; " \ "homebrew/core is source-only." diff --git a/Library/Homebrew/test/rubocops/urls_spec.rb b/Library/Homebrew/test/rubocops/urls_spec.rb index 0be3154ee1..7e884bc71b 100644 --- a/Library/Homebrew/test/rubocops/urls_spec.rb +++ b/Library/Homebrew/test/rubocops/urls_spec.rb @@ -239,8 +239,6 @@ describe RuboCop::Cop::FormulaAudit::Urls do RUBY end end - - include_examples "formulae exist", described_class::BINARY_BOOTSTRAP_FORMULA_URLS_ALLOWLIST end describe RuboCop::Cop::FormulaAudit::PyPiUrls do