Class: Homebrew::TestBot::TapSyntax Private

Inherits:
Test show all
Defined in:
test_bot/tap_syntax.rb

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Instance Attribute Summary

Attributes inherited from Test

#steps

Instance Method Summary collapse

Methods inherited from Test

#failed_steps, #ignored_steps

Methods included from Utils::Output::Mixin

#odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_outside_github_actions, #pretty_duration, #pretty_installed, #pretty_outdated, #pretty_uninstalled

Instance Method Details

#run!(args:) ⇒ Object

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'test_bot/tap_syntax.rb', line 7

def run!(args:)
  test_header(:TapSyntax)
  return unless tap.installed?

  unless args.stable?
    # Run `brew typecheck` if this tap is typed.
    # TODO: consider in future if we want to allow unsupported taps here.
    if tap.official? && quiet_system(git, "-C", tap.path.to_s, "grep", "-qE",
                                     "^# typed: (true|strict|strong)$")
      test "brew", "typecheck", tap.name
    end

    test "brew", "style", tap.name
  end

  return if tap.formula_files.blank? && tap.cask_files.blank?

  test "brew", "readall", "--aliases", "--os=all", "--arch=all", tap.name
  return if args.stable?

  test "brew", "audit", "--except=installed", "--tap=#{tap.name}"
end