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 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