Merge pull request #15953 from Bo98/more-groups
Further split up Gemfile into groups
This commit is contained in:
		
						commit
						4ec5f04e9a
					
				@ -13,7 +13,7 @@ then
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# install Homebrew's development gems
 | 
			
		||||
brew install-bundler-gems --groups=sorbet
 | 
			
		||||
brew install-bundler-gems --groups=all
 | 
			
		||||
 | 
			
		||||
# install Homebrew formulae we might need
 | 
			
		||||
brew install shellcheck shfmt gh gnu-tar
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										42
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										42
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
								
							@ -38,11 +38,11 @@ jobs:
 | 
			
		||||
        uses: actions/cache@v3
 | 
			
		||||
        with:
 | 
			
		||||
          path: ${{ steps.set-up-homebrew.outputs.gems-path }}
 | 
			
		||||
          key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
 | 
			
		||||
          restore-keys: ${{ runner.os }}-rubygems-
 | 
			
		||||
          key: ${{ runner.os }}-rubygems-syntax-${{ steps.set-up-homebrew.outputs.gems-hash }}
 | 
			
		||||
          restore-keys: ${{ runner.os }}-rubygems-syntax-
 | 
			
		||||
 | 
			
		||||
      - name: Install Bundler RubyGems
 | 
			
		||||
        run: brew install-bundler-gems --groups=all
 | 
			
		||||
        run: brew install-bundler-gems --groups=style,typecheck
 | 
			
		||||
 | 
			
		||||
      - name: Install shellcheck and shfmt
 | 
			
		||||
        run: brew install shellcheck shfmt
 | 
			
		||||
@ -82,11 +82,11 @@ jobs:
 | 
			
		||||
        uses: actions/cache@v3
 | 
			
		||||
        with:
 | 
			
		||||
          path: ${{ steps.set-up-homebrew.outputs.gems-path }}
 | 
			
		||||
          key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
 | 
			
		||||
          restore-keys: ${{ runner.os }}-rubygems-
 | 
			
		||||
          key: ${{ runner.os }}-rubygems-tap-syntax-${{ steps.set-up-homebrew.outputs.gems-hash }}
 | 
			
		||||
          restore-keys: ${{ runner.os }}-rubygems-tap-syntax-
 | 
			
		||||
 | 
			
		||||
      - name: Install Bundler RubyGems
 | 
			
		||||
        run: brew install-bundler-gems --groups=all
 | 
			
		||||
        run: brew install-bundler-gems --groups=style
 | 
			
		||||
 | 
			
		||||
      - name: Run brew style on homebrew-core
 | 
			
		||||
        run: brew style homebrew/core
 | 
			
		||||
@ -138,16 +138,6 @@ jobs:
 | 
			
		||||
          cask: false
 | 
			
		||||
          test-bot: false
 | 
			
		||||
 | 
			
		||||
      - name: Cache Bundler RubyGems
 | 
			
		||||
        uses: actions/cache@v3
 | 
			
		||||
        with:
 | 
			
		||||
          path: ${{ steps.set-up-homebrew.outputs.gems-path }}
 | 
			
		||||
          key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
 | 
			
		||||
          restore-keys: ${{ runner.os }}-rubygems-
 | 
			
		||||
 | 
			
		||||
      - name: Install Bundler RubyGems
 | 
			
		||||
        run: brew install-bundler-gems --groups=all
 | 
			
		||||
 | 
			
		||||
      - name: Run brew readall on homebrew/core
 | 
			
		||||
        run: brew readall --os=all --arch=all --aliases homebrew/core
 | 
			
		||||
 | 
			
		||||
@ -171,16 +161,6 @@ jobs:
 | 
			
		||||
          cask: true
 | 
			
		||||
          test-bot: false
 | 
			
		||||
 | 
			
		||||
      - name: Cache Bundler RubyGems
 | 
			
		||||
        uses: actions/cache@v3
 | 
			
		||||
        with:
 | 
			
		||||
          path: ${{ steps.set-up-homebrew.outputs.gems-path }}
 | 
			
		||||
          key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
 | 
			
		||||
          restore-keys: ${{ runner.os }}-rubygems-
 | 
			
		||||
 | 
			
		||||
      - name: Install Bundler RubyGems
 | 
			
		||||
        run: brew install-bundler-gems --groups=all
 | 
			
		||||
 | 
			
		||||
      - name: Set up Homebrew all cask taps
 | 
			
		||||
        run: |
 | 
			
		||||
          brew tap homebrew/cask-fonts
 | 
			
		||||
@ -286,16 +266,6 @@ jobs:
 | 
			
		||||
          cask: false
 | 
			
		||||
          test-bot: false
 | 
			
		||||
 | 
			
		||||
      - name: Cache Bundler RubyGems
 | 
			
		||||
        uses: actions/cache@v3
 | 
			
		||||
        with:
 | 
			
		||||
          path: ${{ steps.set-up-homebrew.outputs.gems-path }}
 | 
			
		||||
          key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
 | 
			
		||||
          restore-keys: ${{ runner.os }}-rubygems-
 | 
			
		||||
 | 
			
		||||
      - name: Install Bundler RubyGems
 | 
			
		||||
        run: brew install-bundler-gems
 | 
			
		||||
 | 
			
		||||
      - name: Run brew update-tests
 | 
			
		||||
        run: |
 | 
			
		||||
          brew update-test
 | 
			
		||||
 | 
			
		||||
@ -73,7 +73,7 @@ RUN mkdir -p \
 | 
			
		||||
  && git -C .linuxbrew/Homebrew remote set-url origin https://github.com/Homebrew/brew \
 | 
			
		||||
  && git -C .linuxbrew/Homebrew fetch origin \
 | 
			
		||||
  && HOMEBREW_NO_ANALYTICS=1 HOMEBREW_NO_AUTO_UPDATE=1 brew tap --force homebrew/core \
 | 
			
		||||
  && brew install-bundler-gems \
 | 
			
		||||
  && brew install-bundler-gems --groups=all \
 | 
			
		||||
  && brew cleanup \
 | 
			
		||||
  && { git -C .linuxbrew/Homebrew config --unset gc.auto; true; } \
 | 
			
		||||
  && { git -C .linuxbrew/Homebrew config --unset homebrew.devcmdrun; true; } \
 | 
			
		||||
 | 
			
		||||
@ -2,6 +2,8 @@
 | 
			
		||||
 | 
			
		||||
source "https://rubygems.org"
 | 
			
		||||
 | 
			
		||||
# The default case (no envs), should always be a restrictive bound on the lowest supported minor version.
 | 
			
		||||
# This is the branch that Dependabot will use.
 | 
			
		||||
if ENV.fetch("HOMEBREW_DEVELOPER", "").empty? || ENV.fetch("HOMEBREW_USE_RUBY_FROM_PATH", "").empty?
 | 
			
		||||
  ruby "~> 2.6.0"
 | 
			
		||||
else
 | 
			
		||||
@ -12,51 +14,68 @@ end
 | 
			
		||||
# * nokogiri - use rexml instead for XML parsing
 | 
			
		||||
 | 
			
		||||
# installed gems (should all be require: false)
 | 
			
		||||
gem "bootsnap", require: false
 | 
			
		||||
gem "byebug", require: false
 | 
			
		||||
gem "json_schemer", require: false
 | 
			
		||||
gem "minitest", require: false
 | 
			
		||||
gem "parallel_tests", require: false
 | 
			
		||||
gem "pry", require: false
 | 
			
		||||
gem "ronn", require: false
 | 
			
		||||
gem "rspec", require: false
 | 
			
		||||
gem "rspec-github", require: false
 | 
			
		||||
gem "rspec-its", require: false
 | 
			
		||||
gem "rspec_junit_formatter", require: false
 | 
			
		||||
gem "rspec-retry", require: false
 | 
			
		||||
gem "rspec-sorbet", require: false
 | 
			
		||||
gem "rubocop", require: false
 | 
			
		||||
gem "rubocop-ast", require: false
 | 
			
		||||
gem "simplecov", require: false
 | 
			
		||||
gem "simplecov-cobertura", require: false
 | 
			
		||||
gem "warning", require: false
 | 
			
		||||
 | 
			
		||||
group :sorbet, optional: true do
 | 
			
		||||
  gem "parlour", require: false
 | 
			
		||||
  gem "sorbet-static-and-runtime", require: false
 | 
			
		||||
  gem "spoom", require: false
 | 
			
		||||
  gem "tapioca", require: false
 | 
			
		||||
# ALL gems that are not vendored should be in a group
 | 
			
		||||
group :ast, optional: true do
 | 
			
		||||
  gem "rubocop-ast", require: false
 | 
			
		||||
end
 | 
			
		||||
group :bootsnap, optional: true do
 | 
			
		||||
  gem "bootsnap", require: false
 | 
			
		||||
end
 | 
			
		||||
group :formula_test, optional: true do
 | 
			
		||||
  gem "minitest", require: false
 | 
			
		||||
end
 | 
			
		||||
group :livecheck, optional: true do
 | 
			
		||||
  gem "ruby-progressbar", require: false
 | 
			
		||||
end
 | 
			
		||||
group :man, optional: true do
 | 
			
		||||
  gem "ronn", require: false
 | 
			
		||||
end
 | 
			
		||||
group :pr_publish, optional: true do
 | 
			
		||||
  gem "json_schemer", require: false
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
group :prof, optional: true do
 | 
			
		||||
  # NOTE: ruby-prof v1.4.3 is the last version that supports Ruby 2.6.x
 | 
			
		||||
  # TODO: remove explicit version when HOMEBREW_REQUIRED_RUBY_VERSION >= 2.7
 | 
			
		||||
  gem "ruby-prof", "1.4.3", require: false
 | 
			
		||||
  gem "stackprof", require: false
 | 
			
		||||
end
 | 
			
		||||
group :pry, optional: true do
 | 
			
		||||
  gem "pry", require: false
 | 
			
		||||
end
 | 
			
		||||
group :style, optional: true do
 | 
			
		||||
  gem "rubocop", require: false
 | 
			
		||||
  gem "rubocop-performance", require: false
 | 
			
		||||
  gem "rubocop-rails", require: false
 | 
			
		||||
  gem "rubocop-rspec", require: false
 | 
			
		||||
  gem "rubocop-sorbet", require: false
 | 
			
		||||
end
 | 
			
		||||
group :tests, optional: true do
 | 
			
		||||
  gem "byebug", require: false
 | 
			
		||||
  gem "parallel_tests", require: false
 | 
			
		||||
  gem "rspec", require: false
 | 
			
		||||
  gem "rspec-github", require: false
 | 
			
		||||
  gem "rspec-its", require: false
 | 
			
		||||
  gem "rspec_junit_formatter", require: false
 | 
			
		||||
  gem "rspec-retry", require: false
 | 
			
		||||
  gem "rspec-sorbet", require: false
 | 
			
		||||
  gem "simplecov", require: false
 | 
			
		||||
  gem "simplecov-cobertura", require: false
 | 
			
		||||
end
 | 
			
		||||
group :typecheck, optional: true do
 | 
			
		||||
  gem "parlour", require: false
 | 
			
		||||
  gem "sorbet-static-and-runtime", require: false
 | 
			
		||||
  gem "spoom", require: false
 | 
			
		||||
  gem "tapioca", require: false
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
# vendored gems
 | 
			
		||||
# vendored gems (no group)
 | 
			
		||||
gem "activesupport"
 | 
			
		||||
gem "addressable"
 | 
			
		||||
gem "concurrent-ruby"
 | 
			
		||||
gem "patchelf"
 | 
			
		||||
gem "plist"
 | 
			
		||||
gem "rubocop-performance"
 | 
			
		||||
gem "rubocop-rails"
 | 
			
		||||
gem "rubocop-rspec"
 | 
			
		||||
gem "rubocop-sorbet"
 | 
			
		||||
gem "ruby-macho"
 | 
			
		||||
gem "sorbet-runtime"
 | 
			
		||||
gem "warning"
 | 
			
		||||
 | 
			
		||||
# TODO: remove when HOMEBREW_REQUIRED_RUBY_VERSION >= 2.7
 | 
			
		||||
install_if -> { RUBY_VERSION < "2.7" } do
 | 
			
		||||
 | 
			
		||||
@ -193,7 +193,6 @@ DEPENDENCIES
 | 
			
		||||
  addressable
 | 
			
		||||
  bootsnap
 | 
			
		||||
  byebug
 | 
			
		||||
  concurrent-ruby
 | 
			
		||||
  did_you_mean
 | 
			
		||||
  json_schemer
 | 
			
		||||
  minitest
 | 
			
		||||
@ -217,6 +216,7 @@ DEPENDENCIES
 | 
			
		||||
  rubocop-sorbet
 | 
			
		||||
  ruby-macho
 | 
			
		||||
  ruby-prof (= 1.4.3)
 | 
			
		||||
  ruby-progressbar
 | 
			
		||||
  simplecov
 | 
			
		||||
  simplecov-cobertura
 | 
			
		||||
  sorbet-runtime
 | 
			
		||||
 | 
			
		||||
@ -94,7 +94,7 @@ module Homebrew
 | 
			
		||||
    args = bottle_args.parse
 | 
			
		||||
 | 
			
		||||
    if args.merge?
 | 
			
		||||
      Homebrew.install_bundler_gems!
 | 
			
		||||
      Homebrew.install_bundler_gems!(groups: ["ast"])
 | 
			
		||||
      return merge(args: args)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -70,7 +70,7 @@ module Homebrew
 | 
			
		||||
    # odeprecated "brew bump-cask-pr --online" if args.online?
 | 
			
		||||
    # This will be run by `brew audit` or `brew style` later so run it first to
 | 
			
		||||
    # not start spamming during normal output.
 | 
			
		||||
    Homebrew.install_bundler_gems! if !args.no_audit? || !args.no_style?
 | 
			
		||||
    Homebrew.install_bundler_gems!(groups: ["style"]) if !args.no_audit? || !args.no_style?
 | 
			
		||||
 | 
			
		||||
    # As this command is simplifying user-run commands then let's just use a
 | 
			
		||||
    # user path, too.
 | 
			
		||||
 | 
			
		||||
@ -117,7 +117,7 @@ module Homebrew
 | 
			
		||||
 | 
			
		||||
    # This will be run by `brew audit` later so run it first to not start
 | 
			
		||||
    # spamming during normal output.
 | 
			
		||||
    Homebrew.install_bundler_gems! unless args.no_audit?
 | 
			
		||||
    Homebrew.install_bundler_gems!(groups: ["style"]) unless args.no_audit?
 | 
			
		||||
 | 
			
		||||
    tap_remote_repo = formula.tap.full_name || formula.tap.remote_repo
 | 
			
		||||
    remote = "origin"
 | 
			
		||||
 | 
			
		||||
@ -51,7 +51,7 @@ module Homebrew
 | 
			
		||||
          end
 | 
			
		||||
        end
 | 
			
		||||
      else
 | 
			
		||||
        Homebrew.install_bundler_gems!
 | 
			
		||||
        Homebrew.install_bundler_gems!(groups: ["ast"])
 | 
			
		||||
        require "utils/ast"
 | 
			
		||||
 | 
			
		||||
        formula_ast = Utils::AST::FormulaAST.new(formula.path.read)
 | 
			
		||||
 | 
			
		||||
@ -63,6 +63,7 @@ module Homebrew
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if args.pry?
 | 
			
		||||
      Homebrew.install_bundler_gems!(groups: ["pry"])
 | 
			
		||||
      require "pry"
 | 
			
		||||
    else
 | 
			
		||||
      require "irb"
 | 
			
		||||
 | 
			
		||||
@ -66,6 +66,8 @@ module Homebrew
 | 
			
		||||
  def livecheck
 | 
			
		||||
    args = livecheck_args.parse
 | 
			
		||||
 | 
			
		||||
    Homebrew.install_bundler_gems!(groups: ["livecheck"]) if args.json?
 | 
			
		||||
 | 
			
		||||
    all = args.eval_all?
 | 
			
		||||
 | 
			
		||||
    if args.debug? && args.verbose?
 | 
			
		||||
 | 
			
		||||
@ -125,9 +125,7 @@ module Homebrew
 | 
			
		||||
 | 
			
		||||
      check_bottled_formulae!(bottles_hash)
 | 
			
		||||
 | 
			
		||||
      # This will be run by `brew bottle` and `brew audit` later so run it first
 | 
			
		||||
      # to not start spamming during normal output.
 | 
			
		||||
      Homebrew.install_bundler_gems!
 | 
			
		||||
      Homebrew.install_bundler_gems!(groups: ["pr_upload", "style"])
 | 
			
		||||
 | 
			
		||||
      safe_system HOMEBREW_BREW_FILE, *bottle_args
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -14,13 +14,15 @@ homebrew-rubocop() {
 | 
			
		||||
  GEM_VERSION="$("${HOMEBREW_RUBY_PATH}" "${HOMEBREW_RUBY_DISABLE_OPTIONS}" -rrbconfig -e 'puts RbConfig::CONFIG["ruby_version"]')"
 | 
			
		||||
  GEM_HOME="${HOMEBREW_LIBRARY}/Homebrew/vendor/bundle/ruby/${GEM_VERSION}"
 | 
			
		||||
  BUNDLE_GEMFILE="${HOMEBREW_LIBRARY}/Homebrew/Gemfile"
 | 
			
		||||
  BUNDLE_WITH="style"
 | 
			
		||||
 | 
			
		||||
  export GEM_HOME
 | 
			
		||||
  export BUNDLE_GEMFILE
 | 
			
		||||
  export BUNDLE_WITH
 | 
			
		||||
 | 
			
		||||
  if ! bundle check &>/dev/null
 | 
			
		||||
  then
 | 
			
		||||
    "${HOMEBREW_BREW_FILE}" install-bundler-gems
 | 
			
		||||
    "${HOMEBREW_BREW_FILE}" install-bundler-gems --add-groups=style
 | 
			
		||||
  fi
 | 
			
		||||
 | 
			
		||||
  export PATH="${GEM_HOME}/bin:${PATH}"
 | 
			
		||||
 | 
			
		||||
@ -85,10 +85,6 @@ module Homebrew
 | 
			
		||||
                key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
 | 
			
		||||
                restore-keys: ${{ runner.os }}-rubygems-
 | 
			
		||||
 | 
			
		||||
            - name: Install Homebrew Bundler RubyGems
 | 
			
		||||
              if: steps.cache.outputs.cache-hit != 'true'
 | 
			
		||||
              run: brew install-bundler-gems
 | 
			
		||||
 | 
			
		||||
            - run: brew test-bot --only-cleanup-before
 | 
			
		||||
 | 
			
		||||
            - run: brew test-bot --only-setup
 | 
			
		||||
 | 
			
		||||
@ -35,7 +35,7 @@ module Homebrew
 | 
			
		||||
  def test
 | 
			
		||||
    args = test_args.parse
 | 
			
		||||
 | 
			
		||||
    Homebrew.install_bundler_gems!(setup_path: false)
 | 
			
		||||
    Homebrew.install_bundler_gems!(groups: ["formula_test"], setup_path: false)
 | 
			
		||||
 | 
			
		||||
    require "formula_assertions"
 | 
			
		||||
    require "formula_free_port"
 | 
			
		||||
 | 
			
		||||
@ -88,7 +88,8 @@ module Homebrew
 | 
			
		||||
  def tests
 | 
			
		||||
    args = tests_args.parse
 | 
			
		||||
 | 
			
		||||
    Homebrew.install_bundler_gems!(groups: ["prof"])
 | 
			
		||||
    # Given we might be testing various commands, we probably want everything (except sorbet-static)
 | 
			
		||||
    Homebrew.install_bundler_gems!(groups: Homebrew.valid_gem_groups - ["sorbet"])
 | 
			
		||||
 | 
			
		||||
    require "byebug" if args.byebug?
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -40,7 +40,7 @@ module Homebrew
 | 
			
		||||
    args = typecheck_args.parse
 | 
			
		||||
 | 
			
		||||
    update = args.update? || args.update_all?
 | 
			
		||||
    groups = update ? Homebrew.valid_gem_groups : ["sorbet"]
 | 
			
		||||
    groups = update ? Homebrew.valid_gem_groups : ["typecheck"]
 | 
			
		||||
    Homebrew.install_bundler_gems!(groups: groups)
 | 
			
		||||
 | 
			
		||||
    HOMEBREW_LIBRARY_PATH.cd do
 | 
			
		||||
 | 
			
		||||
@ -28,7 +28,7 @@ module Homebrew
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    def self.regenerate_man_pages(quiet:)
 | 
			
		||||
      Homebrew.install_bundler_gems!
 | 
			
		||||
      Homebrew.install_bundler_gems!(groups: ["man"])
 | 
			
		||||
 | 
			
		||||
      markup = build_man_page(quiet: quiet)
 | 
			
		||||
      convert_man_page(markup, TARGET_DOC_PATH/"Manpage.md")
 | 
			
		||||
 | 
			
		||||
@ -23,7 +23,7 @@ if homebrew_bootsnap_enabled
 | 
			
		||||
    require "bootsnap"
 | 
			
		||||
  rescue LoadError
 | 
			
		||||
    unless ENV["HOMEBREW_BOOTSNAP_RETRY"]
 | 
			
		||||
      Homebrew.install_bundler_gems!(only_warn_on_failure: true)
 | 
			
		||||
      Homebrew.install_bundler_gems!(groups: ["bootsnap"], only_warn_on_failure: true)
 | 
			
		||||
 | 
			
		||||
      ENV["HOMEBREW_BOOTSNAP_RETRY"] = "1"
 | 
			
		||||
      exec ENV.fetch("HOMEBREW_BREW_FILE"), *ARGV
 | 
			
		||||
 | 
			
		||||
@ -82,7 +82,7 @@ module Homebrew
 | 
			
		||||
    def self.run_rubocop(files, output_type,
 | 
			
		||||
                         fix: false, except_cops: nil, only_cops: nil, display_cop_names: false, reset_cache: false,
 | 
			
		||||
                         debug: false, verbose: false)
 | 
			
		||||
      Homebrew.install_bundler_gems!
 | 
			
		||||
      Homebrew.install_bundler_gems!(groups: ["style"])
 | 
			
		||||
 | 
			
		||||
      require "warnings"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user