From 8f4188926af4198f9dfb3bf9264929208234cc01 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 31 Jul 2020 12:51:07 +0100 Subject: [PATCH 1/2] workflows/tests: run brew audit on homebrew/core. Run brew audit without Git, style (RuboCop) or online checks for homebrew/core. This is fast enough now (takes under a minute on my machine) and these are the audit failures we should never accept failures on (or introduce new ones without fixing them first). --- .github/workflows/tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fa26431353..7e573f2db2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -106,6 +106,9 @@ jobs: # don't care about `brew cask style` here. brew untap adoptopenjdk/openjdk + + # don't care about `brew audit` here. + brew untap mongodb/brew else # Fix permissions for 'brew tests' sudo chmod -R g-w,o-w /home/linuxbrew /home/runner /opt @@ -166,6 +169,9 @@ jobs: if: matrix.os == 'macOS-latest' run: brew cask style + - name: Run brew audit + run: brew audit --skip-style + - name: Run vale for docs linting run: | brew install vale From ea5d52e78836a912db894720e1658d3bad32b503 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 31 Jul 2020 16:37:39 +0100 Subject: [PATCH 2/2] audit: linuxbrew-core fixes. - special-case `adoptopenjdk@1.8` - allow depending on versioned formulae aliases. --- Library/Homebrew/dev-cmd/audit.rb | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 0c4568cd94..7a2891e2d6 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -269,6 +269,12 @@ module Homebrew valid_alias_names.map! { |a| "#{formula.tap}/#{a}" } end + # Fix naming based on what people expect. + if alias_name_major_minor == "adoptopenjdk@1.8" + valid_alias_names << "adoptopenjdk@8" + valid_alias_names.delete "adoptopenjdk@1" + end + valid_versioned_aliases = versioned_aliases & valid_alias_names invalid_versioned_aliases = versioned_aliases - valid_alias_names @@ -284,7 +290,7 @@ module Homebrew end end - unless invalid_versioned_aliases.empty? + if invalid_versioned_aliases.present? problem <<~EOS Formula has invalid versioned aliases: #{invalid_versioned_aliases.join("\n ")} @@ -385,7 +391,7 @@ module Homebrew end if self.class.aliases.include?(dep.name) && - (dep_f.core_formula? || !dep_f.versioned_formula?) + dep_f.core_formula? && !dep_f.versioned_formula? problem "Dependency '#{dep.name}' from homebrew/core is an alias; " \ "use the canonical name '#{dep.to_formula.full_name}'." end @@ -467,6 +473,7 @@ module Homebrew end end + # openssl@1.1 only needed for Linux VERSIONED_KEG_ONLY_ALLOWLIST = %w[ autoconf@2.13 bash-completion@2 @@ -474,6 +481,7 @@ module Homebrew libsigc++@2 lua@5.1 numpy@1.16 + openssl@1.1 python@3.8 ].freeze @@ -489,7 +497,9 @@ module Homebrew end end - return if VERSIONED_KEG_ONLY_ALLOWLIST.include?(formula.name) || formula.name.start_with?("gcc@") + return if VERSIONED_KEG_ONLY_ALLOWLIST.include?(formula.name) + return if formula.name.start_with?("adoptopenjdk@") + return if formula.name.start_with?("gcc@") problem "Versioned formulae in homebrew/core should use `keg_only :versioned_formula`" end