From af6165aab710568b952e158f056d88ef367d6df7 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 2 Sep 2022 08:24:33 +0100 Subject: [PATCH] Automate sponsors updates - Add sponsors updating to the existing man/completion/maintainer update workflow - Hide/deprecated --fail-if-not-changed arguments and make them default behaviour - Rename man-completions workflow to sponsors-maintainers-man-completions for consistency - Make output and exit codes more consistent between these updating commands - Fix maintainers updates not always being committed correctly --- .github/workflows/sorbet.yml | 5 ++- .github/workflows/spdx.yml | 4 +- ... sponsors-maintainers-man-completions.yml} | 43 ++++++++++++++----- .github/workflows/vendor-gems.yml | 14 +++--- .../dev-cmd/generate-man-completions.rb | 28 ++++++------ Library/Homebrew/dev-cmd/typecheck.rb | 5 ++- .../Homebrew/dev-cmd/update-license-data.rb | 16 +++++-- .../Homebrew/dev-cmd/update-maintainers.rb | 7 ++- .../{sponsors.rb => update-sponsors.rb} | 8 ++-- ...onsors_spec.rb => update-sponsors_spec.rb} | 2 +- completions/bash/brew | 38 ++++++++-------- completions/fish/brew.fish | 18 +++----- completions/internal_commands_list.txt | 2 +- completions/zsh/_brew | 24 +++++------ docs/Manpage.md | 20 +++------ manpages/brew.1 | 24 +++-------- 16 files changed, 130 insertions(+), 128 deletions(-) rename .github/workflows/{update-man-completions.yml => sponsors-maintainers-man-completions.yml} (62%) rename Library/Homebrew/dev-cmd/{sponsors.rb => update-sponsors.rb} (93%) rename Library/Homebrew/test/dev-cmd/{sponsors_spec.rb => update-sponsors_spec.rb} (79%) diff --git a/.github/workflows/sorbet.yml b/.github/workflows/sorbet.yml index 4944cfdaaa..d87bf16cdc 100644 --- a/.github/workflows/sorbet.yml +++ b/.github/workflows/sorbet.yml @@ -46,12 +46,13 @@ jobs: if git ls-remote --exit-code --heads origin "${BRANCH}" then git checkout "${BRANCH}" - git reset --hard origin/master + git checkout "${GITHUB_WORKSPACE}/Library/Homebrew/sorbet" else git checkout --no-track -B "${BRANCH}" origin/master fi - if brew typecheck --update --fail-if-not-changed + brew typecheck --update + if ! git diff --stat --exit-code "${GITHUB_WORKSPACE}/Library/Homebrew/sorbet" then git add "${GITHUB_WORKSPACE}/Library/Homebrew/sorbet" git commit -m "sorbet: Update RBI files." \ diff --git a/.github/workflows/spdx.yml b/.github/workflows/spdx.yml index 71ed6a6e6b..7d0a093f72 100644 --- a/.github/workflows/spdx.yml +++ b/.github/workflows/spdx.yml @@ -42,12 +42,12 @@ jobs: if git ls-remote --exit-code --heads origin "${BRANCH}" then git checkout "${BRANCH}" - git reset --hard origin/master + git checkout "${GITHUB_WORKSPACE}/Library/Homebrew/data/spdx" else git checkout --no-track -B "${BRANCH}" origin/master fi - if brew update-license-data --fail-if-not-changed + if brew update-license-data then git add "${GITHUB_WORKSPACE}/Library/Homebrew/data/spdx" git commit -m "spdx: update license data." -m "Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/spdx.yml)." diff --git a/.github/workflows/update-man-completions.yml b/.github/workflows/sponsors-maintainers-man-completions.yml similarity index 62% rename from .github/workflows/update-man-completions.yml rename to .github/workflows/sponsors-maintainers-man-completions.yml index 548d63be6e..38b1f9f62a 100644 --- a/.github/workflows/update-man-completions.yml +++ b/.github/workflows/sponsors-maintainers-man-completions.yml @@ -1,9 +1,9 @@ -name: Update maintainers, manpage and completions +name: Update sponsors, maintainers, manpage and completions on: push: paths: - - .github/workflows/update-man-completions.yml + - .github/workflows/sponsors-maintainers-man-completions.yml - README.md - Library/Homebrew/cmd/** - Library/Homebrew/dev-cmd/** @@ -22,7 +22,7 @@ permissions: contents: read jobs: - update-manpage: + updates: runs-on: ubuntu-latest if: github.repository == 'Homebrew/brew' steps: @@ -39,35 +39,56 @@ jobs: with: signing_key: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY }} - - name: Update maintainers, manpage and completions + - name: Update sponsors, maintainers, manpage and completions id: update run: | git fetch origin - BRANCH=update-man-completions + BRANCH=sponsors-maintainers-man-completions echo "::set-output name=branch::${BRANCH}" if git ls-remote --exit-code --heads origin "${BRANCH}" then git checkout "${BRANCH}" - git reset --hard origin/master + git checkout "${GITHUB_WORKSPACE}/README.md" \ + "${GITHUB_WORKSPACE}/docs/Manpage.md" \ + "${GITHUB_WORKSPACE}/manpages/brew.1" \ + "${GITHUB_WORKSPACE}/completions" else git checkout --no-track -B "${BRANCH}" origin/master fi - if [[ "${{github.event_name}}" != "push" ]] + if brew update-maintainers then - brew update-maintainers + git add "${GITHUB_WORKSPACE}/README.md" \ + "${GITHUB_WORKSPACE}/docs/Manpage.md" \ + "${GITHUB_WORKSPACE}/manpages/brew.1" + git commit -m "Update maintainers." \ + -m "Autogenerated by the [update-man-completions](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/sponsors-maintainers-man-completions.yml) workflow." + COMMITTED=true fi - if brew generate-man-completions --fail-if-not-changed + if brew update-sponsors + then + git add "${GITHUB_WORKSPACE}/README.md" + git commit -m "Update sponsors." \ + -m "Autogenerated by the [update-man-completions](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/sponsors-maintainers-man-completions.yml) workflow." + COMMITTED=true + fi + + if brew generate-man-completions then git add "${GITHUB_WORKSPACE}/README.md" \ "${GITHUB_WORKSPACE}/docs/Manpage.md" \ "${GITHUB_WORKSPACE}/manpages/brew.1" \ "${GITHUB_WORKSPACE}/completions" - git commit -m "Update maintainers, manpage and completions." \ - -m "Autogenerated by the [update-man-completions](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/update-man-completions.yml) workflow." + git commit -m "Update manpage and completions." \ + -m "Autogenerated by the [update-man-completions](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/sponsors-maintainers-man-completions.yml) workflow." + COMMITTED=true + fi + + if [[ -n "$COMMITTED" ]] + then echo "::set-output name=committed::true" PULL_REQUEST_STATE="$(gh pr view --json=state | jq -r ".state")" if [[ "${PULL_REQUEST_STATE}" != "OPEN" ]] diff --git a/.github/workflows/vendor-gems.yml b/.github/workflows/vendor-gems.yml index bbe11aeab8..00a12b3127 100644 --- a/.github/workflows/vendor-gems.yml +++ b/.github/workflows/vendor-gems.yml @@ -60,16 +60,12 @@ jobs: GEM_NAME: ${{ steps.checkout.outputs.gem_name }} HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }} run: | - set -u - - if brew typecheck --update --fail-if-not-changed + brew typecheck --update + if ! git diff --stat --exit-code "${GITHUB_WORKSPACE}/Library/Homebrew/sorbet" then - if git add Library/Homebrew/sorbet - then - git commit -m "Update RBI files for ${GEM_NAME}." - fi - - git reset --hard + git add "${GITHUB_WORKSPACE}/Library/Homebrew/sorbet" + git commit -m "Update RBI files for ${GEM_NAME}." \ + -m "Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gemss.yml) workflow." fi - name: Push to pull request diff --git a/Library/Homebrew/dev-cmd/generate-man-completions.rb b/Library/Homebrew/dev-cmd/generate-man-completions.rb index e9c1f628b6..91d9dabc61 100644 --- a/Library/Homebrew/dev-cmd/generate-man-completions.rb +++ b/Library/Homebrew/dev-cmd/generate-man-completions.rb @@ -23,6 +23,7 @@ module Homebrew Generate Homebrew's manpages and shell completions. EOS switch "--fail-if-not-changed", + hidden: true, description: "Return a failing status code if no changes are detected in the manpage outputs. " \ "This can be used to notify CI when the manpages are out of date. Additionally, " \ "the date used in new manpages will match those in the existing manpages (to allow " \ @@ -34,27 +35,30 @@ module Homebrew def generate_man_completions args = generate_man_completions_args.parse + odeprecated "brew generate-man-completions --fail-if-not-changed" if args.fail_if_not_changed? + Commands.rebuild_internal_commands_completion_list - regenerate_man_pages(preserve_date: args.fail_if_not_changed?, quiet: args.quiet?) + regenerate_man_pages(quiet: args.quiet?) Completions.update_shell_completions! diff = system_command "git", args: [ "-C", HOMEBREW_REPOSITORY, "diff", "--exit-code", "docs/Manpage.md", "manpages", "completions" ] - - return unless diff.status.success? - - puts "No changes to manpage or completions output detected." - Homebrew.failed = true if args.fail_if_not_changed? + if diff.status.success? + ofail "No changes to manpage or completions." + else + puts "Manpage and completions updated." + end end - def regenerate_man_pages(preserve_date:, quiet:) + # TODO: move this method and all called functions to manpages.rb + def regenerate_man_pages(quiet:) Homebrew.install_bundler_gems! markup = build_man_page(quiet: quiet) - convert_man_page(markup, TARGET_DOC_PATH/"Manpage.md", preserve_date: preserve_date) + convert_man_page(markup, TARGET_DOC_PATH/"Manpage.md") markup = I18n.transliterate(markup, locale: :en) - convert_man_page(markup, TARGET_MAN_PATH/"brew.1", preserve_date: preserve_date) + convert_man_page(markup, TARGET_MAN_PATH/"brew.1") end def build_man_page(quiet:) @@ -94,13 +98,13 @@ module Homebrew path.basename.to_s.sub(/\.(rb|sh)$/, "").sub(/^--/, "~~") end - def convert_man_page(markup, target, preserve_date:) + def convert_man_page(markup, target) manual = target.basename(".1") organisation = "Homebrew" - # Set the manpage date to the existing one if we're checking for changes. + # Set the manpage date to the existing one if we're updating. # This avoids the only change being e.g. a new date. - date = if preserve_date && target.extname == ".1" && target.exist? + date = if target.extname == ".1" && target.exist? /"(\d{1,2})" "([A-Z][a-z]+) (\d{4})" "#{organisation}" "#{manual}"/ =~ target.read Date.parse("#{Regexp.last_match(1)} #{Regexp.last_match(2)} #{Regexp.last_match(3)}") else diff --git a/Library/Homebrew/dev-cmd/typecheck.rb b/Library/Homebrew/dev-cmd/typecheck.rb index b9f00a5446..53b10488a8 100644 --- a/Library/Homebrew/dev-cmd/typecheck.rb +++ b/Library/Homebrew/dev-cmd/typecheck.rb @@ -27,6 +27,7 @@ module Homebrew depends_on: "--update", description: "Try upgrading `typed` sigils." switch "--fail-if-not-changed", + hidden: true, description: "Return a failing status code if all gems are up to date " \ "and gem definitions do not need a tapioca update." flag "--dir=", @@ -51,6 +52,8 @@ module Homebrew HOMEBREW_LIBRARY_PATH.cd do if args.update? + odeprecated "brew typecheck --update --fail-if-not-changed" if args.fail_if_not_changed? + excluded_gems = [ "did_you_mean", # RBI file is already provided by Sorbet "webrobots", # RBI file is bugged @@ -100,8 +103,6 @@ module Homebrew end end - Homebrew.failed = system("git", "diff", "--stat", "--exit-code") if args.fail_if_not_changed? - return end diff --git a/Library/Homebrew/dev-cmd/update-license-data.rb b/Library/Homebrew/dev-cmd/update-license-data.rb index 158596937c..a83fe60055 100644 --- a/Library/Homebrew/dev-cmd/update-license-data.rb +++ b/Library/Homebrew/dev-cmd/update-license-data.rb @@ -3,9 +3,11 @@ require "cli/parser" require "utils/spdx" +require "system_command" module Homebrew extend T::Sig + include SystemCommand::Mixin module_function @@ -16,6 +18,7 @@ module Homebrew Update SPDX license data in the Homebrew repository. EOS switch "--fail-if-not-changed", + hidden: true, description: "Return a failing status code if current license data's version is the same as " \ "the upstream. This can be used to notify CI when the SPDX license data is out of date." @@ -25,11 +28,16 @@ module Homebrew def update_license_data args = update_license_data_args.parse - ohai "Updating SPDX license data..." + odeprecated "brew update-license-data --fail-if-not-changed" if args.fail_if_not_changed? SPDX.download_latest_license_data! - return unless args.fail_if_not_changed? - - Homebrew.failed = system("git", "diff", "--stat", "--exit-code", SPDX::DATA_PATH) + diff = system_command "git", args: [ + "-C", HOMEBREW_REPOSITORY, "diff", "--exit-code", SPDX::DATA_PATH + ] + if diff.status.success? + ofail "No changes to SPDX license data." + else + puts "SPDX license data updated." + end end end diff --git a/Library/Homebrew/dev-cmd/update-maintainers.rb b/Library/Homebrew/dev-cmd/update-maintainers.rb index 01d1ff582c..2b66682777 100644 --- a/Library/Homebrew/dev-cmd/update-maintainers.rb +++ b/Library/Homebrew/dev-cmd/update-maintainers.rb @@ -3,6 +3,8 @@ require "cli/parser" require "utils/github" + +# TODO: move function to manpages.rb and require that instead require "dev-cmd/generate-man-completions" module Homebrew @@ -57,9 +59,10 @@ module Homebrew "-C", HOMEBREW_REPOSITORY, "diff", "--exit-code", "README.md" ] if diff.status.success? - puts "No changes to list of maintainers." + ofail "No changes to list of maintainers." else - Homebrew.regenerate_man_pages(preserve_date: true, quiet: true) + # TODO: move function to manpages.rb and call that instead + Homebrew.regenerate_man_pages(quiet: true) puts "List of maintainers updated in the README and the generated man pages." end end diff --git a/Library/Homebrew/dev-cmd/sponsors.rb b/Library/Homebrew/dev-cmd/update-sponsors.rb similarity index 93% rename from Library/Homebrew/dev-cmd/sponsors.rb rename to Library/Homebrew/dev-cmd/update-sponsors.rb index 8a51f50f9e..a831d96287 100644 --- a/Library/Homebrew/dev-cmd/sponsors.rb +++ b/Library/Homebrew/dev-cmd/update-sponsors.rb @@ -13,7 +13,7 @@ module Homebrew URL_TIER_AMOUNT = 1000 sig { returns(CLI::Parser) } - def sponsors_args + def update_sponsors_args Homebrew::CLI::Parser.new do description <<~EOS Update the list of GitHub Sponsors in the `Homebrew/brew` README. @@ -35,8 +35,8 @@ module Homebrew "https://github.com/#{s["login"]}" end - def sponsors - sponsors_args.parse + def update_sponsors + update_sponsors_args.parse named_sponsors = [] logo_sponsors = [] @@ -68,7 +68,7 @@ module Homebrew "-C", HOMEBREW_REPOSITORY, "diff", "--exit-code", "README.md" ] if diff.status.success? - puts "No changes to list of sponsors." + ofail "No changes to list of sponsors." else puts "List of sponsors updated in the README." end diff --git a/Library/Homebrew/test/dev-cmd/sponsors_spec.rb b/Library/Homebrew/test/dev-cmd/update-sponsors_spec.rb similarity index 79% rename from Library/Homebrew/test/dev-cmd/sponsors_spec.rb rename to Library/Homebrew/test/dev-cmd/update-sponsors_spec.rb index cc50843f3e..80e57b309f 100644 --- a/Library/Homebrew/test/dev-cmd/sponsors_spec.rb +++ b/Library/Homebrew/test/dev-cmd/update-sponsors_spec.rb @@ -3,6 +3,6 @@ require "cmd/shared_examples/args_parse" -describe "brew sponsors" do +describe "brew update-sponsors" do it_behaves_like "parseable arguments" end diff --git a/completions/bash/brew b/completions/bash/brew index 4d918ab053..aa964a0711 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -976,7 +976,6 @@ _brew_generate_man_completions() { -*) __brewcomp " --debug - --fail-if-not-changed --help --quiet --verbose @@ -1880,22 +1879,6 @@ _brew_sh() { __brew_complete_files } -_brew_sponsors() { - local cur="${COMP_WORDS[COMP_CWORD]}" - case "${cur}" in - -*) - __brewcomp " - --debug - --help - --quiet - --verbose - " - return - ;; - *) - esac -} - _brew_style() { local cur="${COMP_WORDS[COMP_CWORD]}" case "${cur}" in @@ -1993,7 +1976,6 @@ _brew_tc() { --all --debug --dir - --fail-if-not-changed --file --fix --help @@ -2062,7 +2044,6 @@ _brew_typecheck() { --all --debug --dir - --fail-if-not-changed --file --fix --help @@ -2262,7 +2243,6 @@ _brew_update_license_data() { -*) __brewcomp " --debug - --fail-if-not-changed --help --quiet --verbose @@ -2331,6 +2311,22 @@ _brew_update_report() { esac } +_brew_update_sponsors() { + local cur="${COMP_WORDS[COMP_CWORD]}" + case "${cur}" in + -*) + __brewcomp " + --debug + --help + --quiet + --verbose + " + return + ;; + *) + esac +} + _brew_update_test() { local cur="${COMP_WORDS[COMP_CWORD]}" case "${cur}" in @@ -2552,7 +2548,6 @@ _brew() { ruby) _brew_ruby ;; search) _brew_search ;; sh) _brew_sh ;; - sponsors) _brew_sponsors ;; style) _brew_style ;; tap) _brew_tap ;; tap-info) _brew_tap_info ;; @@ -2574,6 +2569,7 @@ _brew() { update-maintainers) _brew_update_maintainers ;; update-python-resources) _brew_update_python_resources ;; update-report) _brew_update_report ;; + update-sponsors) _brew_update_sponsors ;; update-test) _brew_update_test ;; upgrade) _brew_upgrade ;; uses) _brew_uses ;; diff --git a/completions/fish/brew.fish b/completions/fish/brew.fish index 7629c67255..4285886c8b 100644 --- a/completions/fish/brew.fish +++ b/completions/fish/brew.fish @@ -716,7 +716,6 @@ __fish_brew_complete_arg 'formula' -a '(__fish_brew_suggest_formulae_all)' __fish_brew_complete_cmd 'generate-man-completions' 'Generate Homebrew\'s manpages and shell completions' __fish_brew_complete_arg 'generate-man-completions' -l debug -d 'Display any debugging information' -__fish_brew_complete_arg 'generate-man-completions' -l fail-if-not-changed -d 'Return a failing status code if no changes are detected in the manpage outputs. This can be used to notify CI when the manpages are out of date. Additionally, the date used in new manpages will match those in the existing manpages (to allow comparison without factoring in the date)' __fish_brew_complete_arg 'generate-man-completions' -l help -d 'Show this message' __fish_brew_complete_arg 'generate-man-completions' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'generate-man-completions' -l verbose -d 'Make some output more verbose' @@ -1289,13 +1288,6 @@ __fish_brew_complete_arg 'sh' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'sh' -l verbose -d 'Make some output more verbose' -__fish_brew_complete_cmd 'sponsors' 'Update the list of GitHub Sponsors in the `Homebrew/brew` README' -__fish_brew_complete_arg 'sponsors' -l debug -d 'Display any debugging information' -__fish_brew_complete_arg 'sponsors' -l help -d 'Show this message' -__fish_brew_complete_arg 'sponsors' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_arg 'sponsors' -l verbose -d 'Make some output more verbose' - - __fish_brew_complete_cmd 'style' 'Check formulae or files for conformance to Homebrew style guidelines' __fish_brew_complete_arg 'style' -l cask -d 'Treat all named arguments as casks' __fish_brew_complete_arg 'style' -l debug -d 'Display any debugging information' @@ -1352,7 +1344,6 @@ __fish_brew_complete_cmd 'tc' 'Check for typechecking errors using Sorbet' __fish_brew_complete_arg 'tc' -l all -d 'Regenerate all RBI files rather than just updated gems' __fish_brew_complete_arg 'tc' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'tc' -l dir -d 'Typecheck all files in a specific directory' -__fish_brew_complete_arg 'tc' -l fail-if-not-changed -d 'Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update' __fish_brew_complete_arg 'tc' -l file -d 'Typecheck a single file' __fish_brew_complete_arg 'tc' -l fix -d 'Automatically fix type errors' __fish_brew_complete_arg 'tc' -l help -d 'Show this message' @@ -1394,7 +1385,6 @@ __fish_brew_complete_cmd 'typecheck' 'Check for typechecking errors using Sorbet __fish_brew_complete_arg 'typecheck' -l all -d 'Regenerate all RBI files rather than just updated gems' __fish_brew_complete_arg 'typecheck' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'typecheck' -l dir -d 'Typecheck all files in a specific directory' -__fish_brew_complete_arg 'typecheck' -l fail-if-not-changed -d 'Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update' __fish_brew_complete_arg 'typecheck' -l file -d 'Typecheck a single file' __fish_brew_complete_arg 'typecheck' -l fix -d 'Automatically fix type errors' __fish_brew_complete_arg 'typecheck' -l help -d 'Show this message' @@ -1504,7 +1494,6 @@ __fish_brew_complete_arg 'update' -l verbose -d 'Print the directories checked a __fish_brew_complete_cmd 'update-license-data' 'Update SPDX license data in the Homebrew repository' __fish_brew_complete_arg 'update-license-data' -l debug -d 'Display any debugging information' -__fish_brew_complete_arg 'update-license-data' -l fail-if-not-changed -d 'Return a failing status code if current license data\'s version is the same as the upstream. This can be used to notify CI when the SPDX license data is out of date' __fish_brew_complete_arg 'update-license-data' -l help -d 'Show this message' __fish_brew_complete_arg 'update-license-data' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'update-license-data' -l verbose -d 'Make some output more verbose' @@ -1541,6 +1530,13 @@ __fish_brew_complete_arg 'update-report' -l quiet -d 'Make some output more quie __fish_brew_complete_arg 'update-report' -l verbose -d 'Make some output more verbose' +__fish_brew_complete_cmd 'update-sponsors' 'Update the list of GitHub Sponsors in the `Homebrew/brew` README' +__fish_brew_complete_arg 'update-sponsors' -l debug -d 'Display any debugging information' +__fish_brew_complete_arg 'update-sponsors' -l help -d 'Show this message' +__fish_brew_complete_arg 'update-sponsors' -l quiet -d 'Make some output more quiet' +__fish_brew_complete_arg 'update-sponsors' -l verbose -d 'Make some output more verbose' + + __fish_brew_complete_cmd 'update-test' 'Run a test of `brew update` with a new repository clone' __fish_brew_complete_arg 'update-test' -l before -d 'Use the commit at the specified date as the start commit' __fish_brew_complete_arg 'update-test' -l commit -d 'Use the specified commit as the start commit' diff --git a/completions/internal_commands_list.txt b/completions/internal_commands_list.txt index 408b5635d0..7e74430e25 100644 --- a/completions/internal_commands_list.txt +++ b/completions/internal_commands_list.txt @@ -79,7 +79,6 @@ ruby search sh shellenv -sponsors style tap tap-info @@ -100,6 +99,7 @@ update-license-data update-maintainers update-python-resources update-reset +update-sponsors update-test upgrade uses diff --git a/completions/zsh/_brew b/completions/zsh/_brew index 959c2e0d03..df267c6af5 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -196,7 +196,6 @@ __brew_internal_commands() { 'search:Perform a substring search of cask tokens and formula names for text' 'sh:Enter an interactive shell for Homebrew'\''s build environment' 'shellenv:Print export statements' - 'sponsors:Update the list of GitHub Sponsors in the `Homebrew/brew` README' 'style:Check formulae or files for conformance to Homebrew style guidelines' 'tap:Tap a formula repository' 'tap-info:Show detailed information about one or more taps' @@ -216,6 +215,7 @@ __brew_internal_commands() { 'update-python-resources:Update versions for PyPI resource blocks in formula' 'update-report:The Ruby implementation of `brew update`' 'update-reset:Fetch and reset Homebrew and all tap repositories (or any specified repository) using `git`(1) to their latest `origin/HEAD`' + 'update-sponsors:Update the list of GitHub Sponsors in the `Homebrew/brew` README' 'update-test:Run a test of `brew update` with a new repository clone' 'upgrade:Upgrade outdated casks and outdated, unpinned formulae using the same options they were originally installed with, plus any appended brew formula options' 'uses:Show formulae and casks that specify formula as a dependency; that is, show dependents of formula' @@ -882,7 +882,6 @@ _brew_formula() { _brew_generate_man_completions() { _arguments \ '--debug[Display any debugging information]' \ - '--fail-if-not-changed[Return a failing status code if no changes are detected in the manpage outputs. This can be used to notify CI when the manpages are out of date. Additionally, the date used in new manpages will match those in the existing manpages (to allow comparison without factoring in the date)]' \ '--help[Show this message]' \ '--quiet[Make some output more quiet]' \ '--verbose[Make some output more verbose]' @@ -1570,15 +1569,6 @@ _brew_sh() { '*::file:__brew_formulae_or_ruby_files' } -# brew sponsors -_brew_sponsors() { - _arguments \ - '--debug[Display any debugging information]' \ - '--help[Show this message]' \ - '--quiet[Make some output more quiet]' \ - '--verbose[Make some output more verbose]' -} - # brew style _brew_style() { _arguments \ @@ -1653,7 +1643,6 @@ _brew_tc() { '--all[Regenerate all RBI files rather than just updated gems]' \ '--debug[Display any debugging information]' \ '(--file)--dir[Typecheck all files in a specific directory]' \ - '--fail-if-not-changed[Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update]' \ '(--dir)--file[Typecheck a single file]' \ '--fix[Automatically fix type errors]' \ '--help[Show this message]' \ @@ -1702,7 +1691,6 @@ _brew_typecheck() { '--all[Regenerate all RBI files rather than just updated gems]' \ '--debug[Display any debugging information]' \ '(--file)--dir[Typecheck all files in a specific directory]' \ - '--fail-if-not-changed[Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update]' \ '(--dir)--file[Typecheck a single file]' \ '--fix[Automatically fix type errors]' \ '--help[Show this message]' \ @@ -1841,7 +1829,6 @@ _brew_update() { _brew_update_license_data() { _arguments \ '--debug[Display any debugging information]' \ - '--fail-if-not-changed[Return a failing status code if current license data'\''s version is the same as the upstream. This can be used to notify CI when the SPDX license data is out of date]' \ '--help[Show this message]' \ '--quiet[Make some output more quiet]' \ '--verbose[Make some output more verbose]' @@ -1885,6 +1872,15 @@ _brew_update_report() { '--verbose[Make some output more verbose]' } +# brew update-sponsors +_brew_update_sponsors() { + _arguments \ + '--debug[Display any debugging information]' \ + '--help[Show this message]' \ + '--quiet[Make some output more quiet]' \ + '--verbose[Make some output more verbose]' +} + # brew update-test _brew_update_test() { _arguments \ diff --git a/docs/Manpage.md b/docs/Manpage.md index 1569289ccc..f227e55487 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -1198,13 +1198,10 @@ a formula from a tap that is not `homebrew/core` use its fully-qualified form of Display the path where *`formula`* is located. -### `generate-man-completions` [*`--fail-if-not-changed`*] +### `generate-man-completions` Generate Homebrew's manpages and shell completions. -* `--fail-if-not-changed`: - Return a failing status code if no changes are detected in the manpage outputs. This can be used to notify CI when the manpages are out of date. Additionally, the date used in new manpages will match those in the existing manpages (to allow comparison without factoring in the date). - ### `install-bundler-gems` [*`--groups`*`=`] Install Homebrew's Bundler gems. @@ -1411,10 +1408,6 @@ which build systems would not find otherwise. * `-c`, `--cmd`: Execute commands in a non-interactive shell. -### `sponsors` - -Update the list of GitHub Sponsors in the `Homebrew/brew` README. - ### `style` [*`options`*] [*`file`*|*`tap`*|*`formula`*|*`cask`* ...] Check formulae or files for conformance to Homebrew style guidelines. @@ -1503,8 +1496,6 @@ Check for typechecking errors using Sorbet. Regenerate all RBI files rather than just updated gems. * `--suggest-typed`: Try upgrading `typed` sigils. -* `--fail-if-not-changed`: - Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update. * `--dir`: Typecheck all files in a specific directory. * `--file`: @@ -1537,13 +1528,10 @@ working directory. * `-f`, `--force`: Overwrite the destination directory if it already exists. -### `update-license-data` [*`--fail-if-not-changed`*] +### `update-license-data` Update SPDX license data in the Homebrew repository. -* `--fail-if-not-changed`: - Return a failing status code if current license data's version is the same as the upstream. This can be used to notify CI when the SPDX license data is out of date. - ### `update-maintainers` Update the list of maintainers in the `Homebrew/brew` README. @@ -1567,6 +1555,10 @@ Update versions for PyPI resource blocks in *`formula`*. * `--exclude-packages`: Exclude these packages when finding resources. +### `update-sponsors` + +Update the list of GitHub Sponsors in the `Homebrew/brew` README. + ### `update-test` [*`options`*] Run a test of `brew update` with a new repository clone. diff --git a/manpages/brew.1 b/manpages/brew.1 index d9a2e5f67b..ce0ff42fb2 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BREW" "1" "August 2022" "Homebrew" "brew" +.TH "BREW" "1" "September 2022" "Homebrew" "brew" . .SH "NAME" \fBbrew\fR \- The Missing Package Manager for macOS (or Linux) @@ -1712,13 +1712,9 @@ Overwrite the destination formula if it already exists\. .SS "\fBformula\fR \fIformula\fR [\.\.\.]" Display the path where \fIformula\fR is located\. . -.SS "\fBgenerate\-man\-completions\fR [\fI\-\-fail\-if\-not\-changed\fR]" +.SS "\fBgenerate\-man\-completions\fR" Generate Homebrew\'s manpages and shell completions\. . -.TP -\fB\-\-fail\-if\-not\-changed\fR -Return a failing status code if no changes are detected in the manpage outputs\. This can be used to notify CI when the manpages are out of date\. Additionally, the date used in new manpages will match those in the existing manpages (to allow comparison without factoring in the date)\. -. .SS "\fBinstall\-bundler\-gems\fR [\fI\-\-groups\fR\fB=\fR]" Install Homebrew\'s Bundler gems\. . @@ -2011,9 +2007,6 @@ Use the standard \fBPATH\fR instead of superenv\'s when \fBstd\fR is passed\. \fB\-c\fR, \fB\-\-cmd\fR Execute commands in a non\-interactive shell\. . -.SS "\fBsponsors\fR" -Update the list of GitHub Sponsors in the \fBHomebrew/brew\fR README\. -. .SS "\fBstyle\fR [\fIoptions\fR] [\fIfile\fR|\fItap\fR|\fIformula\fR|\fIcask\fR \.\.\.]" Check formulae or files for conformance to Homebrew style guidelines\. . @@ -2148,10 +2141,6 @@ Regenerate all RBI files rather than just updated gems\. Try upgrading \fBtyped\fR sigils\. . .TP -\fB\-\-fail\-if\-not\-changed\fR -Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update\. -. -.TP \fB\-\-dir\fR Typecheck all files in a specific directory\. . @@ -2197,13 +2186,9 @@ Initialise a Git repository in the unpacked source\. This is useful for creating \fB\-f\fR, \fB\-\-force\fR Overwrite the destination directory if it already exists\. . -.SS "\fBupdate\-license\-data\fR [\fI\-\-fail\-if\-not\-changed\fR]" +.SS "\fBupdate\-license\-data\fR" Update SPDX license data in the Homebrew repository\. . -.TP -\fB\-\-fail\-if\-not\-changed\fR -Return a failing status code if current license data\'s version is the same as the upstream\. This can be used to notify CI when the SPDX license data is out of date\. -. .SS "\fBupdate\-maintainers\fR" Update the list of maintainers in the \fBHomebrew/brew\fR README\. . @@ -2238,6 +2223,9 @@ Include these additional packages when finding resources\. \fB\-\-exclude\-packages\fR Exclude these packages when finding resources\. . +.SS "\fBupdate\-sponsors\fR" +Update the list of GitHub Sponsors in the \fBHomebrew/brew\fR README\. +. .SS "\fBupdate\-test\fR [\fIoptions\fR]" Run a test of \fBbrew update\fR with a new repository clone\. If no options are passed, use \fBorigin/master\fR as the start commit\. .