From a6643b4adf13f7bb5b7ba7f771241a471189d946 Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Mon, 6 Jul 2020 15:29:15 -0400 Subject: [PATCH 01/13] fix odebug calls --- Library/Homebrew/cask/audit.rb | 2 +- Library/Homebrew/formula_versions.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index 9ff80580e0..da142f6820 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -82,7 +82,7 @@ module Cask check_bitbucket_repository self rescue => e - odebug "#{e.message}\n#{e.backtrace.join("\n")}" + odebug e, e.backtrace add_error "exception while auditing #{cask}: #{e.message}" self end diff --git a/Library/Homebrew/formula_versions.rb b/Library/Homebrew/formula_versions.rb index c33726de0e..5bb2fb4494 100644 --- a/Library/Homebrew/formula_versions.rb +++ b/Library/Homebrew/formula_versions.rb @@ -50,7 +50,7 @@ class FormulaVersions rescue *IGNORED_EXCEPTIONS => e # We rescue these so that we can skip bad versions and # continue walking the history - odebug "#{e} in #{name} at revision #{rev}", e.backtrace if debug? + odebug "#{e} in #{name} at revision #{rev}", e.backtrace rescue FormulaUnavailableError nil ensure @@ -69,7 +69,7 @@ class FormulaVersions end return map if versions_seen > MAX_VERSIONS_DEPTH rescue MacOSVersionError => e - odebug "#{e} in #{name} at revision #{rev}" if debug? + odebug "#{e} in #{name} at revision #{rev}" break end map From 571179ff0ecab9bc03b1b7109ed24ccab187dc03 Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Mon, 6 Jul 2020 15:30:57 -0400 Subject: [PATCH 02/13] pass second argument to ohai when applicable --- .../Homebrew/cask/artifact/abstract_uninstall.rb | 3 +-- Library/Homebrew/cask/artifact/pkg.rb | 4 ++-- Library/Homebrew/cask/caskroom.rb | 4 ++-- Library/Homebrew/cmd/search.rb | 8 ++------ Library/Homebrew/cmd/update-report.rb | 13 +++---------- Library/Homebrew/dev-cmd/extract.rb | 3 +-- Library/Homebrew/dev-cmd/irb.rb | 3 +-- Library/Homebrew/extend/ENV/shared.rb | 3 +-- Library/Homebrew/mktemp.rb | 5 +---- Library/Homebrew/sandbox.rb | 3 +-- Library/Homebrew/unpack_strategy/dmg.rb | 3 +-- 11 files changed, 16 insertions(+), 36 deletions(-) diff --git a/Library/Homebrew/cask/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/artifact/abstract_uninstall.rb index 9a67669be3..2eb0967222 100644 --- a/Library/Homebrew/cask/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/artifact/abstract_uninstall.rb @@ -367,8 +367,7 @@ module Cask resolved_paths = each_resolved_path(:trash, paths).to_a - ohai "Trashing files:" - puts resolved_paths.map(&:first) + ohai "Trashing files:", resolved_paths.map(&:first) trash_paths(*resolved_paths.flat_map(&:last), **options) end diff --git a/Library/Homebrew/cask/artifact/pkg.rb b/Library/Homebrew/cask/artifact/pkg.rb index f6eef1e42c..8099865081 100644 --- a/Library/Homebrew/cask/artifact/pkg.rb +++ b/Library/Homebrew/cask/artifact/pkg.rb @@ -39,8 +39,8 @@ module Cask private def run_installer(command: nil, verbose: false, **_options) - ohai "Running installer for #{cask}; your password may be necessary." - ohai "Package installers may write to any location; options such as --appdir are ignored." + ohai "Running installer for #{cask}; your password may be necessary.", + "Package installers may write to any location; options such as --appdir are ignored." unless path.exist? pkg = path.relative_path_from(cask.staged_path) pkgs = Pathname.glob(cask.staged_path/"**"/"*.pkg").map { |path| path.relative_path_from(cask.staged_path) } diff --git a/Library/Homebrew/cask/caskroom.rb b/Library/Homebrew/cask/caskroom.rb index 8d91d4582f..c65d5649ac 100644 --- a/Library/Homebrew/cask/caskroom.rb +++ b/Library/Homebrew/cask/caskroom.rb @@ -22,8 +22,8 @@ module Cask sudo = !path.parent.writable? if sudo && !ENV.key?("SUDO_ASKPASS") && $stdout.tty? - ohai "Creating Caskroom at #{path}" - ohai "We'll set permissions properly so we won't need sudo in the future." + ohai "Creating Caskroom directory: #{path}", + "We'll set permissions properly so we won't need sudo in the future." end SystemCommand.run("/bin/mkdir", args: ["-p", path], sudo: sudo) diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 2bffd8e704..9d13a85c37 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -119,15 +119,11 @@ module Homebrew print_casks = args.cask? print_formulae = print_casks = true if !print_formulae && !print_casks - if print_formulae && all_formulae.any? - ohai "Formulae" - puts Formatter.columns(all_formulae) - end + ohai "Formulae", Formatter.columns(all_formulae) if print_formulae && all_formulae.any? if print_casks && all_casks.any? puts if args.formula? && all_formulae.any? - ohai "Casks" - puts Formatter.columns(all_casks) + ohai "Casks", Formatter.columns(all_casks) end count = all_formulae.count + all_casks.count diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index 7b4f87324e..b3a0d48e83 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -470,10 +470,7 @@ class ReporterHub dump_formula_report :M, "Updated Formulae" else updated = select_formula(:M).count - if updated.positive? - ohai "Updated Formulae" - puts "Updated #{updated} #{"formula".pluralize(updated)}." - end + ohai "Updated Formulae", "Updated #{updated} #{"formula".pluralize(updated)}." if updated.positive? end dump_formula_report :R, "Renamed Formulae" dump_formula_report :D, "Deleted Formulae" @@ -482,10 +479,7 @@ class ReporterHub dump_formula_report :MC, "Updated Casks" else updated = select_formula(:MC).count - if updated.positive? - ohai "Updated Casks" - puts "Updated #{updated} #{"cask".pluralize(updated)}." - end + ohai "Updated Casks", "Updated #{updated} #{"cask".pluralize(updated)}." if updated.positive? end dump_formula_report :DC, "Deleted Casks" end @@ -525,8 +519,7 @@ class ReporterHub return if formulae.empty? # Dump formula list. - ohai title - puts Formatter.columns(formulae.sort) + ohai title, Formatter.columns(formulae.sort) end def installed?(formula) diff --git a/Library/Homebrew/dev-cmd/extract.rb b/Library/Homebrew/dev-cmd/extract.rb index abc3073b63..cb7d0dcc77 100644 --- a/Library/Homebrew/dev-cmd/extract.rb +++ b/Library/Homebrew/dev-cmd/extract.rb @@ -214,8 +214,7 @@ module Homebrew odebug "Overwriting existing formula at #{path}" path.delete end - ohai "Writing formula for #{name} from revision #{rev} to:" - puts path + ohai "Writing formula for #{name} from revision #{rev} to:", path path.write result end diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb index 6fae810920..2fc25c2e28 100644 --- a/Library/Homebrew/dev-cmd/irb.rb +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -59,8 +59,7 @@ module Homebrew require "keg" require "cask" - ohai "Interactive Homebrew Shell" - puts "Example commands available with: brew irb --examples" + ohai "Interactive Homebrew Shell", "Example commands available with: brew irb --examples" if args.pry? Pry.start else diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb index ca6ad76f11..2777f56adb 100644 --- a/Library/Homebrew/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/ENV/shared.rb @@ -276,8 +276,7 @@ module SharedEnvExtension flags = [] if fc - ohai "Building with an alternative Fortran compiler" - puts "This is unsupported." + ohai "Building with an alternative Fortran compiler", "This is unsupported." self["F77"] ||= fc else if (gfortran = which("gfortran", (HOMEBREW_PREFIX/"bin").to_s)) diff --git a/Library/Homebrew/mktemp.rb b/Library/Homebrew/mktemp.rb index ac58541b08..fb1eeb5397 100644 --- a/Library/Homebrew/mktemp.rb +++ b/Library/Homebrew/mktemp.rb @@ -65,9 +65,6 @@ class Mktemp ignore_interrupts { rm_rf(tmpdir) } unless retain? end ensure - if retain? && !@tmpdir.nil? && !@quiet - ohai "Kept temporary files" - puts "Temporary files retained at #{@tmpdir}" - end + ohai "Temporary files retained at:", @tmpdir.to_s if retain? && !@tmpdir.nil? && !@quiet end end diff --git a/Library/Homebrew/sandbox.rb b/Library/Homebrew/sandbox.rb index f2c0dcabf0..459a5384f1 100644 --- a/Library/Homebrew/sandbox.rb +++ b/Library/Homebrew/sandbox.rb @@ -127,8 +127,7 @@ class Sandbox end if @failed && Homebrew::EnvConfig.verbose? - ohai "Sandbox log" - puts logs + ohai "Sandbox log", logs $stdout.flush # without it, brew test-bot would fail to catch the log end end diff --git a/Library/Homebrew/unpack_strategy/dmg.rb b/Library/Homebrew/unpack_strategy/dmg.rb index d7d84285ad..2b04e12d44 100644 --- a/Library/Homebrew/unpack_strategy/dmg.rb +++ b/Library/Homebrew/unpack_strategy/dmg.rb @@ -194,8 +194,7 @@ module UnpackStrategy ) if verbose && !(eula_text = without_eula.stdout).empty? - ohai "Software License Agreement for '#{path}':" - puts eula_text + ohai "Software License Agreement for '#{path}':", eula_text end with_eula.plist From f5e1557154dab1720c8ddf1c48598ebe70205359 Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Wed, 29 Jul 2020 19:41:39 -0400 Subject: [PATCH 03/13] use ofail to set Homebrew.failed --- Library/Homebrew/cmd/doctor.rb | 3 +-- Library/Homebrew/cmd/fetch.rb | 2 +- Library/Homebrew/formula_installer.rb | 18 ++++++------------ Library/Homebrew/upgrade.rb | 3 +-- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index a832cf51d3..85551db322 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -57,8 +57,7 @@ module Homebrew methods.each do |method| $stderr.puts Formatter.headline("Checking #{method}", color: :magenta) if args.debug? unless checks.respond_to?(method) - Homebrew.failed = true - puts "No check available by the name: #{method}" + ofail "No check available by the name: #{method}" next end diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index c96441cd59..9445446ed5 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -150,8 +150,8 @@ module Homebrew def fetch_patch(p, args:) fetch_fetchable p, args: args rescue ChecksumMismatchError => e - Homebrew.failed = true opoo "Patch reports different sha256: #{e.expected}" + Homebrew.failed = true end def retry_fetch?(f, args:) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 469cd5153b..dd2e64d76d 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -951,10 +951,9 @@ class FormulaInstaller begin keg.optlink(verbose: verbose?) rescue Keg::LinkError => e - onoe "Failed to create #{formula.opt_prefix}" + ofail "Failed to create #{formula.opt_prefix}" puts "Things that depend on #{formula.full_name} will probably not build." puts e - Homebrew.failed = true end return end @@ -991,25 +990,23 @@ class FormulaInstaller link_overwrite_backup[conflict_file] = backup_file retry end - onoe "The `brew link` step did not complete successfully" + ofail "The `brew link` step did not complete successfully" puts "The formula built, but is not symlinked into #{HOMEBREW_PREFIX}" puts e puts puts "Possible conflicting files are:" keg.link(dry_run: true, overwrite: true, verbose: verbose?) @show_summary_heading = true - Homebrew.failed = true rescue Keg::LinkError => e - onoe "The `brew link` step did not complete successfully" + ofail "The `brew link` step did not complete successfully" puts "The formula built, but is not symlinked into #{HOMEBREW_PREFIX}" puts e puts puts "You can try again using:" puts " brew link #{formula.name}" @show_summary_heading = true - Homebrew.failed = true rescue Exception => e # rubocop:disable Lint/RescueException - onoe "An unexpected error occurred during the `brew link` step" + ofail "An unexpected error occurred during the `brew link` step" puts "The formula built, but is not symlinked into #{HOMEBREW_PREFIX}" puts e puts e.backtrace if debug? @@ -1021,7 +1018,6 @@ class FormulaInstaller FileUtils.mv backup, origin end end - Homebrew.failed = true raise end @@ -1043,20 +1039,18 @@ class FormulaInstaller log = formula.var/"log" log.mkpath if formula.plist.include? log.to_s rescue Exception => e # rubocop:disable Lint/RescueException - onoe "Failed to install plist file" + ofail "Failed to install plist file" odebug e, e.backtrace - Homebrew.failed = true end sig { params(keg: Keg).void } def fix_dynamic_linkage(keg) keg.fix_dynamic_linkage rescue Exception => e # rubocop:disable Lint/RescueException - onoe "Failed to fix install linkage" + ofail "Failed to fix install linkage" puts "The formula built, but you may encounter issues using it or linking other" puts "formulae against it." odebug e, e.backtrace - Homebrew.failed = true @show_summary_heading = true end diff --git a/Library/Homebrew/upgrade.rb b/Library/Homebrew/upgrade.rb index 02a0af9a77..c74cff3ce4 100644 --- a/Library/Homebrew/upgrade.rb +++ b/Library/Homebrew/upgrade.rb @@ -36,8 +36,7 @@ module Homebrew upgrade_formula(f, args: args) Cleanup.install_formula_clean!(f) rescue UnsatisfiedRequirements => e - Homebrew.failed = true - onoe "#{f}: #{e}" + ofail "#{f}: #{e}" end end end From a72ddfdc675b4675207506c4626fca1b019b54f7 Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Mon, 6 Jul 2020 15:28:50 -0400 Subject: [PATCH 04/13] remove duplicate "Error" in onoe/odie arguments --- Library/Homebrew/brew.sh | 2 +- Library/Homebrew/migrator.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 59c6ec3817..59069b3946 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -92,7 +92,7 @@ odie() { } safe_cd() { - cd "$@" >/dev/null || odie "Error: failed to cd to $*!" + cd "$@" >/dev/null || odie "Failed to cd to $*!" } brew() { diff --git a/Library/Homebrew/migrator.rb b/Library/Homebrew/migrator.rb index 778a41ea4e..e065a2de63 100644 --- a/Library/Homebrew/migrator.rb +++ b/Library/Homebrew/migrator.rb @@ -220,7 +220,7 @@ class Migrator rescue Interrupt ignore_interrupts { backup_oldname } rescue Exception => e # rubocop:disable Lint/RescueException - onoe "Error occurred while migrating." + onoe "The migration did not complete successfully." puts e puts e.backtrace if debug? puts "Backing up..." @@ -314,14 +314,14 @@ class Migrator begin new_keg.link(overwrite: true, verbose: verbose?) rescue Keg::ConflictError => e - onoe "Error while executing `brew link` step on #{newname}" + onoe "The `brew link` step did not complete successfully." puts e puts puts "Possible conflicting files are:" new_keg.link(dry_run: true, overwrite: true, verbose: verbose?) raise rescue Keg::LinkError => e - onoe "Error while linking" + onoe "The `brew link` step did not complete successfully." puts e puts puts "You can try again using:" From 2e982cd2a28ffbbde40305e98e8d142c2874c8cf Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Thu, 3 Dec 2020 00:02:22 -0500 Subject: [PATCH 05/13] use odie when commands encounter errors --- Library/Homebrew/cmd/gist-logs.rb | 2 +- Library/Homebrew/cmd/install.rb | 4 ++-- Library/Homebrew/cmd/migrate.rb | 3 ++- Library/Homebrew/cmd/search.rb | 2 +- Library/Homebrew/dev-cmd/create.rb | 4 ++-- Library/Homebrew/dev-cmd/edit.rb | 2 +- Library/Homebrew/dev-cmd/pr-pull.rb | 2 +- Library/Homebrew/dev-cmd/tap-new.rb | 4 ++-- Library/Homebrew/dev-cmd/unpack.rb | 4 ++-- Library/Homebrew/dev-cmd/update-test.rb | 2 +- 10 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Library/Homebrew/cmd/gist-logs.rb b/Library/Homebrew/cmd/gist-logs.rb index 8f9a77891e..86436de503 100644 --- a/Library/Homebrew/cmd/gist-logs.rb +++ b/Library/Homebrew/cmd/gist-logs.rb @@ -103,7 +103,7 @@ module Homebrew logs[file.basename.to_s] = { content: contents } end end - raise "No logs." if logs.empty? + odie "No logs." if logs.empty? logs end diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 14455e8bd1..08e7e09675 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -183,14 +183,14 @@ module Homebrew formulae.each do |f| # head-only without --HEAD is an error if !args.HEAD? && f.stable.nil? - raise <<~EOS + odie <<~EOS #{f.full_name} is a head-only formula Install with `brew install --HEAD #{f.full_name}` EOS end # --HEAD, fail with no head defined - raise "No head is defined for #{f.full_name}" if args.HEAD? && f.head.nil? + odie "No head is defined for #{f.full_name}" if args.HEAD? && f.head.nil? installed_head_version = f.latest_head_version if installed_head_version && diff --git a/Library/Homebrew/cmd/migrate.rb b/Library/Homebrew/cmd/migrate.rb index 34d61ea942..b33c204f63 100644 --- a/Library/Homebrew/cmd/migrate.rb +++ b/Library/Homebrew/cmd/migrate.rb @@ -31,7 +31,8 @@ module Homebrew if f.oldname rack = HOMEBREW_CELLAR/f.oldname raise NoSuchKegError, f.oldname if !rack.exist? || rack.subdirs.empty? - raise "#{rack} is a symlink" if rack.symlink? + + odie "#{rack} is a symlink" if rack.symlink? end migrator = Migrator.new(f, force: args.force?) diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 9d13a85c37..c21c5255e9 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -136,7 +136,7 @@ module Homebrew puts reason end - raise "No formulae or casks found for #{query.inspect}." if count.zero? + odie "No formulae or casks found for #{query.inspect}." if count.zero? end return unless $stdout.tty? diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb index 1fa947fdce..bf6e540e0c 100644 --- a/Library/Homebrew/dev-cmd/create.rb +++ b/Library/Homebrew/dev-cmd/create.rb @@ -180,7 +180,7 @@ module Homebrew # unless --force is specified. unless args.force? if reason = MissingFormula.disallowed_reason(fc.name) - raise <<~EOS + odie <<~EOS The formula '#{fc.name}' is not allowed to be created. #{reason} If you really want to create this formula use `--force`. @@ -189,7 +189,7 @@ module Homebrew if Formula.aliases.include? fc.name realname = Formulary.canonical_name(fc.name) - raise <<~EOS + odie <<~EOS The formula '#{realname}' is already aliased to '#{fc.name}'. Please check that you are not creating a duplicate. To force creation use `--force`. diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb index 54ab8e650c..60aaacdd62 100644 --- a/Library/Homebrew/dev-cmd/edit.rb +++ b/Library/Homebrew/dev-cmd/edit.rb @@ -32,7 +32,7 @@ module Homebrew args = edit_args.parse unless (HOMEBREW_REPOSITORY/".git").directory? - raise <<~EOS + odie <<~EOS Changes will be lost! The first time you `brew update`, all local changes will be lost; you should thus `brew update` before you `brew edit`! diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb index d71d65aca2..fbf1a3c266 100644 --- a/Library/Homebrew/dev-cmd/pr-pull.rb +++ b/Library/Homebrew/dev-cmd/pr-pull.rb @@ -340,7 +340,7 @@ module Homebrew end def download_artifact(url, dir, pr) - raise "Credentials must be set to access the Artifacts API" if GitHub.api_credentials_type == :none + odie "Credentials must be set to access the Artifacts API" if GitHub.api_credentials_type == :none token = GitHub.api_credentials curl_args = ["--header", "Authorization: token #{token}"] diff --git a/Library/Homebrew/dev-cmd/tap-new.rb b/Library/Homebrew/dev-cmd/tap-new.rb index 6d01a3ee9a..e2043eeb73 100644 --- a/Library/Homebrew/dev-cmd/tap-new.rb +++ b/Library/Homebrew/dev-cmd/tap-new.rb @@ -37,7 +37,7 @@ module Homebrew branch = args.branch || "main" tap = args.named.to_taps.first - raise "Invalid tap name '#{tap_name}'" unless tap.path.to_s.match?(HOMEBREW_TAP_PATH_REGEX) + odie "Invalid tap name '#{tap_name}'" unless tap.path.to_s.match?(HOMEBREW_TAP_PATH_REGEX) titleized_user = tap.user.dup titleized_repo = tap.repo.dup @@ -169,7 +169,7 @@ module Homebrew def write_path(tap, filename, content) path = tap.path/filename tap.path.mkpath - raise "#{path} already exists" if path.exist? + odie "#{path} already exists" if path.exist? path.write content end diff --git a/Library/Homebrew/dev-cmd/unpack.rb b/Library/Homebrew/dev-cmd/unpack.rb index 14f9a2e0af..feecfc80d2 100644 --- a/Library/Homebrew/dev-cmd/unpack.rb +++ b/Library/Homebrew/dev-cmd/unpack.rb @@ -45,13 +45,13 @@ module Homebrew unpack_dir = Pathname.pwd end - raise "Cannot write to #{unpack_dir}" unless unpack_dir.writable_real? + odie "Cannot write to #{unpack_dir}" unless unpack_dir.writable_real? formulae.each do |f| stage_dir = unpack_dir/"#{f.name}-#{f.version}" if stage_dir.exist? - raise "Destination #{stage_dir} already exists!" unless args.force? + odie "Destination #{stage_dir} already exists!" unless args.force? rm_rf stage_dir end diff --git a/Library/Homebrew/dev-cmd/update-test.rb b/Library/Homebrew/dev-cmd/update-test.rb index 3de5641385..3d8063a569 100644 --- a/Library/Homebrew/dev-cmd/update-test.rb +++ b/Library/Homebrew/dev-cmd/update-test.rb @@ -134,7 +134,7 @@ module Homebrew start_log = Utils.popen_read("git", "log", "-1", "--decorate", "--oneline", start_commit).chomp end_log = Utils.popen_read("git", "log", "-1", "--decorate", "--oneline", end_commit).chomp actual_log = Utils.popen_read("git", "log", "-1", "--decorate", "--oneline", actual_end_commit).chomp - raise <<~EOS + odie <<~EOS brew update didn't update #{branch}! Start commit: #{start_log} Expected end commit: #{end_log} From d0ad829e43ab529b3bfd32a974f824633e6bc67c Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Mon, 6 Jul 2020 15:31:47 -0400 Subject: [PATCH 06/13] use arrow character for UI prompts --- Library/Homebrew/cask/artifact/abstract_uninstall.rb | 7 +++++-- Library/Homebrew/cask/cmd/fetch.rb | 2 +- Library/Homebrew/cask/dsl/caveats.rb | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/cask/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/artifact/abstract_uninstall.rb index 2eb0967222..7705f9f65d 100644 --- a/Library/Homebrew/cask/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/artifact/abstract_uninstall.rb @@ -133,8 +133,11 @@ module Cask sig { returns(String) } def automation_access_instructions - "Enable Automation Access for “Terminal > System Events” in " \ - "“System Preferences > Security > Privacy > Automation” if you haven't already." + <<~EOS + Enable Automation access for "Terminal → System Events" in: + System Preferences → Security & Privacy → Privacy → Automation + if you haven't already. + EOS end # :quit/:signal must come before :kext so the kext will not be in use by a running process diff --git a/Library/Homebrew/cask/cmd/fetch.rb b/Library/Homebrew/cask/cmd/fetch.rb index 855efa7f0f..b9239216ae 100644 --- a/Library/Homebrew/cask/cmd/fetch.rb +++ b/Library/Homebrew/cask/cmd/fetch.rb @@ -43,7 +43,7 @@ module Cask download = Download.new(cask, **options) download.clear_cache if args.force? downloaded_path = download.fetch - ohai "Success! Downloaded to -> #{downloaded_path}" + ohai "Success! Downloaded to: #{downloaded_path}" end end end diff --git a/Library/Homebrew/cask/dsl/caveats.rb b/Library/Homebrew/cask/dsl/caveats.rb index 705a6b35c9..17641990c0 100644 --- a/Library/Homebrew/cask/dsl/caveats.rb +++ b/Library/Homebrew/cask/dsl/caveats.rb @@ -69,15 +69,15 @@ module Cask end caveat :unsigned_accessibility do |access = "Accessibility"| - # access: the category in System Preferences -> Security & Privacy -> Privacy the app requires. + # access: the category in System Preferences > Security & Privacy > Privacy the app requires. <<~EOS #{@cask} is not signed and requires Accessibility access, so you will need to re-grant Accessibility access every time the app is updated. Enable or re-enable it in: - System Preferences → Security & Privacy → Privacy -> #{access} - To re-enable untick and retick #{@cask}.app. + System Preferences → Security & Privacy → Privacy → #{access} + To re-enable, untick and retick #{@cask}.app. EOS end From c0a753edd3a3e5802887c5c92e96977e3e814843 Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Mon, 6 Jul 2020 15:41:58 -0400 Subject: [PATCH 07/13] pluralize "artifacts" --- Library/Homebrew/cask/installer.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index 804c433d5d..42dbe44791 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -212,11 +212,11 @@ module Cask end def install_artifacts + artifacts = @cask.artifacts already_installed_artifacts = [] odebug "Installing artifacts" - artifacts = @cask.artifacts - odebug "#{artifacts.length} artifact/s defined", artifacts + odebug "#{artifacts.length} #{"artifact".pluralize(artifacts.length)} defined", artifacts artifacts.each do |artifact| next unless artifact.respond_to?(:install_phase) @@ -459,10 +459,10 @@ module Cask end def uninstall_artifacts(clear: false) - odebug "Uninstalling artifacts" artifacts = @cask.artifacts - odebug "#{artifacts.length} artifact/s defined", artifacts + odebug "Uninstalling artifacts" + odebug "#{artifacts.length} #{"artifact".pluralize(artifacts.length)} defined", artifacts artifacts.each do |artifact| if artifact.respond_to?(:uninstall_phase) From a427de5bee50646a974fa8acd96a62ed0fbc10fa Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Wed, 29 Jul 2020 17:31:11 -0400 Subject: [PATCH 08/13] capitalization fixes "curl" is the binary, while "cURL" is the umbrella project. --- Library/Homebrew/brew.sh | 6 +++--- Library/Homebrew/build.rb | 2 +- Library/Homebrew/cask/cmd/internal_stanza.rb | 2 +- Library/Homebrew/cask/dsl/caveats.rb | 2 +- Library/Homebrew/cask/installer.rb | 2 +- Library/Homebrew/cmd/update.sh | 4 ++-- Library/Homebrew/dev-cmd/bump-formula-pr.rb | 2 +- Library/Homebrew/dev-cmd/create.rb | 2 +- Library/Homebrew/dev-cmd/edit.rb | 2 +- Library/Homebrew/dev-cmd/unpack.rb | 2 +- Library/Homebrew/diagnostic.rb | 2 +- Library/Homebrew/extend/pathname.rb | 6 +++--- Library/Homebrew/formula.rb | 6 +++--- Library/Homebrew/language/go.rb | 4 ++-- Library/Homebrew/livecheck/livecheck.rb | 2 +- Library/Homebrew/rubocops/urls.rb | 4 ++-- Library/Homebrew/sandbox.rb | 2 +- Library/Homebrew/tap.rb | 2 +- Library/Homebrew/test.rb | 4 ++-- Library/Homebrew/test/bash_spec.rb | 4 ++-- Library/Homebrew/test/cask/cask_spec.rb | 4 ++-- Library/Homebrew/test/cask/cmd/info_spec.rb | 2 +- Library/Homebrew/test/caveats_spec.rb | 2 +- Library/Homebrew/test/download_strategies_spec.rb | 2 +- .../rubocops/cask/homepage_url_trailing_slash_spec.rb | 6 +++--- Library/Homebrew/test/rubocops/urls_spec.rb | 10 +++++----- Library/Homebrew/test/support/fixtures/failball.rb | 2 +- Library/Homebrew/test/utils/shell_spec.rb | 4 ++-- Library/Homebrew/utils/curl.rb | 2 +- Library/Homebrew/utils/pypi.rb | 2 +- 30 files changed, 49 insertions(+), 49 deletions(-) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 59069b3946..7feeac9f23 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -382,10 +382,10 @@ else curl_name_and_version="${curl_version_output%% (*}" if [[ $(numeric "${curl_name_and_version##* }") -lt $(numeric "$HOMEBREW_MINIMUM_CURL_VERSION") ]] then - message="Please update your system cURL. + message="Please update your system curl. Minimum required version: ${HOMEBREW_MINIMUM_CURL_VERSION} -Your cURL version: ${curl_name_and_version##* } -Your cURL executable: $(type -p $HOMEBREW_CURL)" +Your curl version: ${curl_name_and_version##* } +Your curl executable: $(type -p $HOMEBREW_CURL)" if [[ -z $HOMEBREW_CURL_PATH || -z $HOMEBREW_DEVELOPER ]]; then HOMEBREW_SYSTEM_CURL_TOO_OLD=1 diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index cd715d7dac..92a5c99971 100644 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -157,7 +157,7 @@ class Build puts "Install to this prefix: #{formula.prefix}" if args.git? - puts "This directory is now a git repo. Make your changes and then use:" + puts "This directory is now a Git repo. Make your changes and then use:" puts " git diff | pbcopy" puts "to copy the diff to the clipboard." end diff --git a/Library/Homebrew/cask/cmd/internal_stanza.rb b/Library/Homebrew/cask/cmd/internal_stanza.rb index 3183588b82..e134dd87d0 100644 --- a/Library/Homebrew/cask/cmd/internal_stanza.rb +++ b/Library/Homebrew/cask/cmd/internal_stanza.rb @@ -98,7 +98,7 @@ module Cask begin value = cask.send(stanza) rescue - opoo "failure calling '#{stanza}' on Cask '#{cask}'" unless args.quiet? + opoo "Failure calling '#{stanza}' on Cask '#{cask}'" unless args.quiet? puts "" next end diff --git a/Library/Homebrew/cask/dsl/caveats.rb b/Library/Homebrew/cask/dsl/caveats.rb index 17641990c0..55c77cb117 100644 --- a/Library/Homebrew/cask/dsl/caveats.rb +++ b/Library/Homebrew/cask/dsl/caveats.rb @@ -84,7 +84,7 @@ module Cask caveat :path_environment_variable do |path| <<~EOS To use #{@cask}, you may need to add the #{path} directory - to your PATH environment variable, e.g. (for bash shell): + to your PATH environment variable, e.g. (for Bash shell): export PATH=#{path}:"$PATH" EOS end diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index 42dbe44791..bd4cbd6aa9 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -356,7 +356,7 @@ module Cask missing_formulae_and_casks = missing_cask_and_formula_dependencies if missing_formulae_and_casks.empty? - puts "All Formula dependencies satisfied." + puts "All formula dependencies satisfied." return end diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 415eac59a5..8b1ea9f54b 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -370,7 +370,7 @@ EOS # we cannot install a Homebrew cURL if homebrew/core is unavailable. if [[ ! -d "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core" ]] || ! brew install curl then - odie "Curl must be installed and in your PATH!" + odie "'curl' must be installed and in your PATH!" fi fi @@ -381,7 +381,7 @@ EOS # we cannot install a Homebrew Git if homebrew/core is unavailable. if [[ ! -d "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core" ]] || ! brew install git then - odie "Git must be installed and in your PATH!" + odie "'git' must be installed and in your PATH!" fi fi diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 7e57a7e597..896a57937e 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -351,7 +351,7 @@ module Homebrew alias_rename = alias_update_pair(formula, new_formula_version) if alias_rename.present? - ohai "renaming alias #{alias_rename.first} to #{alias_rename.last}" + ohai "Renaming alias #{alias_rename.first} to #{alias_rename.last}" alias_rename.map! { |a| formula.tap.alias_dir/a } end diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb index bf6e540e0c..23f9b7bdbc 100644 --- a/Library/Homebrew/dev-cmd/create.rb +++ b/Library/Homebrew/dev-cmd/create.rb @@ -145,7 +145,7 @@ module Homebrew fc.tap = Tap.fetch(args.tap || "homebrew/core") raise TapUnavailableError, args.tap unless fc.tap.installed? - fc.url = args.named.first # Pull the first (and only) url from ARGV + fc.url = args.named.first # Pull the first (and only) URL from ARGV fc.mode = if args.autotools? :autotools diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb index 60aaacdd62..2a1d137148 100644 --- a/Library/Homebrew/dev-cmd/edit.rb +++ b/Library/Homebrew/dev-cmd/edit.rb @@ -44,7 +44,7 @@ module Homebrew raise UsageError, "#{path} doesn't exist on disk. " \ "Run #{Formatter.identifier("brew create --set-name #{path.basename} $URL")} " \ - "to create a new Formula!" + "to create a new formula!" end.presence # If no brews are listed, open the project root in an editor. diff --git a/Library/Homebrew/dev-cmd/unpack.rb b/Library/Homebrew/dev-cmd/unpack.rb index feecfc80d2..011b87b224 100644 --- a/Library/Homebrew/dev-cmd/unpack.rb +++ b/Library/Homebrew/dev-cmd/unpack.rb @@ -68,7 +68,7 @@ module Homebrew next unless args.git? - ohai "Setting up git repository" + ohai "Setting up Git repository" cd stage_dir system "git", "init", "-q" system "git", "add", "-A" diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index e2828e33a4..60ac07a04a 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -715,7 +715,7 @@ module Homebrew return if (paths & gnubin).empty? <<~EOS - Putting non-prefixed coreutils in your path can cause gmp builds to fail. + Putting non-prefixed coreutils in your path can cause GMP builds to fail. EOS rescue FormulaUnavailableError nil diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index dfec348867..3930deb3bc 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -100,13 +100,13 @@ class Pathname src.resource.stage { install(*src.files) } when Array if src.empty? - opoo "tried to install empty array to #{self}" + opoo "Tried to install empty array to #{self}" break end src.each { |s| install_p(s, File.basename(s)) } when Hash if src.empty? - opoo "tried to install empty hash to #{self}" + opoo "Tried to install empty hash to #{self}" break end src.each { |s, new_basename| install_p(s, new_basename) } @@ -372,7 +372,7 @@ class Pathname def write_exec_script(*targets) targets.flatten! if targets.empty? - opoo "tried to write exec scripts to #{self} for an empty list of targets" + opoo "Tried to write exec scripts to #{self} for an empty list of targets" return end mkpath diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index c719f5fe69..7a5ca81540 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -828,7 +828,7 @@ class Formula HOMEBREW_PREFIX/"var" end - # The directory where the formula's ZSH function files should be + # The directory where the formula's zsh function files should be # installed. # This is symlinked into `HOMEBREW_PREFIX` after installation or with # `brew link` for formulae that are not keg-only. @@ -852,7 +852,7 @@ class Formula prefix/"etc/bash_completion.d" end - # The directory where the formula's ZSH completion files should be + # The directory where the formula's zsh completion files should be # installed. # This is symlinked into `HOMEBREW_PREFIX` after installation or with # `brew link` for formulae that are not keg-only. @@ -1705,7 +1705,7 @@ class Formula deps ||= declared_runtime_dependencies unless undeclared deps ||= (declared_runtime_dependencies | undeclared_runtime_dependencies) rescue FormulaUnavailableError - onoe "could not get runtime dependencies from #{path}!" + onoe "Could not get runtime dependencies from #{path}!" deps ||= [] end deps diff --git a/Library/Homebrew/language/go.rb b/Library/Homebrew/language/go.rb index ecf3465d76..90bd711dd9 100644 --- a/Library/Homebrew/language/go.rb +++ b/Library/Homebrew/language/go.rb @@ -15,9 +15,9 @@ module Language def self.stage_deps(resources, target) if resources.empty? if Homebrew::EnvConfig.developer? - odie "tried to stage empty Language::Go resources array" + odie "Tried to stage empty Language::Go resources array" else - opoo "tried to stage empty Language::Go resources array" + opoo "Tried to stage empty Language::Go resources array" end end resources.grep(Resource::Go) { |resource| resource.stage(target) } diff --git a/Library/Homebrew/livecheck/livecheck.rb b/Library/Homebrew/livecheck/livecheck.rb index 2fa2c974dd..83b7a78961 100644 --- a/Library/Homebrew/livecheck/livecheck.rb +++ b/Library/Homebrew/livecheck/livecheck.rb @@ -492,7 +492,7 @@ module Homebrew end if livecheck_strategy.present? && livecheck_url.blank? - odebug "#{strategy_name} strategy requires a url" + odebug "#{strategy_name} strategy requires a URL" next end diff --git a/Library/Homebrew/rubocops/urls.rb b/Library/Homebrew/rubocops/urls.rb index 74bf2dd33a..67aa7d29c2 100644 --- a/Library/Homebrew/rubocops/urls.rb +++ b/Library/Homebrew/rubocops/urls.rb @@ -293,7 +293,7 @@ module RuboCop next if url_has_revision?(parameters(url).last) offending_node(url) - problem "Formulae in homebrew/core should specify a revision for git urls" + problem "Formulae in homebrew/core should specify a revision for git URLs" end end @@ -316,7 +316,7 @@ module RuboCop next if url_has_tag?(parameters(url).last) offending_node(url) - problem "Formulae in homebrew/core should specify a tag for git urls" + problem "Formulae in homebrew/core should specify a tag for git URLs" end end diff --git a/Library/Homebrew/sandbox.rb b/Library/Homebrew/sandbox.rb index 459a5384f1..56486ac9a7 100644 --- a/Library/Homebrew/sandbox.rb +++ b/Library/Homebrew/sandbox.rb @@ -127,7 +127,7 @@ class Sandbox end if @failed && Homebrew::EnvConfig.verbose? - ohai "Sandbox log", logs + ohai "Sandbox Log", logs $stdout.flush # without it, brew test-bot would fail to catch the log end end diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index da6a653fa1..986e35dc13 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -209,7 +209,7 @@ class Tap return "N/A" unless installed? pretty_revision = git_short_head - return "(no git repository)" unless pretty_revision + return "(no Git repository)" unless pretty_revision "(git revision #{pretty_revision}; last commit #{git_last_commit_date})" end diff --git a/Library/Homebrew/test.rb b/Library/Homebrew/test.rb index c92cdaf0d2..72f373c8bb 100644 --- a/Library/Homebrew/test.rb +++ b/Library/Homebrew/test.rb @@ -26,8 +26,8 @@ begin trap("INT", old_trap) if Homebrew::EnvConfig.developer? || ENV["CI"].present? - raise "cannot find child processes without `pgrep`, please install!" unless which("pgrep") - raise "cannot kill child processes without `pkill`, please install!" unless which("pkill") + raise "Cannot find child processes without `pgrep`, please install!" unless which("pgrep") + raise "Cannot kill child processes without `pkill`, please install!" unless which("pkill") end formula = T.must(args.named.to_resolved_formulae.first) diff --git a/Library/Homebrew/test/bash_spec.rb b/Library/Homebrew/test/bash_spec.rb index 3a7827c853..178db5777a 100644 --- a/Library/Homebrew/test/bash_spec.rb +++ b/Library/Homebrew/test/bash_spec.rb @@ -25,7 +25,7 @@ describe "Bash" do end context "every `.sh` file" do - it "has valid bash syntax" do + it "has valid Bash syntax" do Pathname.glob("#{HOMEBREW_LIBRARY_PATH}/**/*.sh").each do |path| relative_path = path.relative_path_from(HOMEBREW_LIBRARY_PATH) next if relative_path.to_s.start_with?("shims/", "test/", "vendor/") @@ -42,7 +42,7 @@ describe "Bash" do end context "every shim script" do - it "has valid bash syntax" do + it "has valid Bash syntax" do # These have no file extension, but can be identified by their shebang. (HOMEBREW_LIBRARY_PATH/"shims").find do |path| next if path.directory? diff --git a/Library/Homebrew/test/cask/cask_spec.rb b/Library/Homebrew/test/cask/cask_spec.rb index 6badf576a7..2072dff887 100644 --- a/Library/Homebrew/test/cask/cask_spec.rb +++ b/Library/Homebrew/test/cask/cask_spec.rb @@ -41,13 +41,13 @@ describe Cask::Cask, :cask do expect(c.token).to eq("local-caffeine") end - it "returns an instance of the Cask from a url" do + it "returns an instance of the Cask from a URL" do c = Cask::CaskLoader.load("file://#{tap_path}/Casks/local-caffeine.rb") expect(c).to be_kind_of(described_class) expect(c.token).to eq("local-caffeine") end - it "raises an error when failing to download a Cask from a url" do + it "raises an error when failing to download a Cask from a URL" do expect { url = "file://#{tap_path}/Casks/notacask.rb" diff --git a/Library/Homebrew/test/cask/cmd/info_spec.rb b/Library/Homebrew/test/cask/cmd/info_spec.rb index 8839c5b8b4..00481ced43 100644 --- a/Library/Homebrew/test/cask/cmd/info_spec.rb +++ b/Library/Homebrew/test/cask/cmd/info_spec.rb @@ -98,7 +98,7 @@ describe Cask::Cmd::Info, :cask do Custom text via puts followed by DSL-generated text: To use with-caveats, you may need to add the /custom/path/bin directory - to your PATH environment variable, e.g. (for bash shell): + to your PATH environment variable, e.g. (for Bash shell): export PATH=/custom/path/bin:"$PATH" EOS diff --git a/Library/Homebrew/test/caveats_spec.rb b/Library/Homebrew/test/caveats_spec.rb index 8cc954869c..922dc4a930 100644 --- a/Library/Homebrew/test/caveats_spec.rb +++ b/Library/Homebrew/test/caveats_spec.rb @@ -192,7 +192,7 @@ describe Caveats do allow(Utils::Shell).to receive(:parent).and_return(nil) end - it "gives dir where bash completions have been installed" do + it "gives dir where Bash completions have been installed" do (path/"etc/bash_completion.d").mkpath expect(caveats).to include(HOMEBREW_PREFIX/"etc/bash_completion.d") end diff --git a/Library/Homebrew/test/download_strategies_spec.rb b/Library/Homebrew/test/download_strategies_spec.rb index 120294835a..0a59c06e03 100644 --- a/Library/Homebrew/test/download_strategies_spec.rb +++ b/Library/Homebrew/test/download_strategies_spec.rb @@ -419,7 +419,7 @@ describe DownloadStrategyDetector do it { is_expected.to eq(GitHubGitDownloadStrategy) } end - it "defaults to cURL" do + it "defaults to curl" do expect(subject).to eq(CurlDownloadStrategy) end diff --git a/Library/Homebrew/test/rubocops/cask/homepage_url_trailing_slash_spec.rb b/Library/Homebrew/test/rubocops/cask/homepage_url_trailing_slash_spec.rb index 05d98bec5a..148c6a6077 100644 --- a/Library/Homebrew/test/rubocops/cask/homepage_url_trailing_slash_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/homepage_url_trailing_slash_spec.rb @@ -9,7 +9,7 @@ describe RuboCop::Cop::Cask::HomepageUrlTrailingSlash do subject(:cop) { described_class.new } - context "when the homepage url ends with a slash" do + context "when the homepage URL ends with a slash" do let(:source) do <<-CASK.undent cask 'foo' do @@ -21,7 +21,7 @@ describe RuboCop::Cop::Cask::HomepageUrlTrailingSlash do include_examples "does not report any offenses" end - context "when the homepage url does not end with a slash but has a path" do + context "when the homepage URL does not end with a slash but has a path" do let(:source) do <<-CASK.undent cask 'foo' do @@ -33,7 +33,7 @@ describe RuboCop::Cop::Cask::HomepageUrlTrailingSlash do include_examples "does not report any offenses" end - context "when the homepage url does not end with a slash and has no path" do + context "when the homepage URL does not end with a slash and has no path" do let(:source) do <<-CASK.undent cask 'foo' do diff --git a/Library/Homebrew/test/rubocops/urls_spec.rb b/Library/Homebrew/test/rubocops/urls_spec.rb index 39da4b50be..0e5dc29a10 100644 --- a/Library/Homebrew/test/rubocops/urls_spec.rb +++ b/Library/Homebrew/test/rubocops/urls_spec.rb @@ -280,7 +280,7 @@ describe RuboCop::Cop::FormulaAudit::GitUrls do subject(:cop) { described_class.new } context "when a git URL is used" do - it "reports no offenses with a non-git url" do + it "reports no offenses with a non-git URL" do expect_no_offenses(<<~RUBY, "/homebrew-core/") class Foo < Formula desc "foo" @@ -329,7 +329,7 @@ describe RuboCop::Cop::FormulaAudit::GitUrls do class Foo < Formula desc "foo" url "https://github.com/foo/bar.git", - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should specify a revision for git urls + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should specify a revision for git URLs tag: "v1.0.0" end RUBY @@ -340,7 +340,7 @@ describe RuboCop::Cop::FormulaAudit::GitUrls do class Foo < Formula desc "foo" url "https://github.com/foo/bar.git", - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should specify a revision for git urls + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should specify a revision for git URLs shallow: false, tag: "v1.0.0" end @@ -435,7 +435,7 @@ describe RuboCop::Cop::FormulaAuditStrict::GitUrls do class Foo < Formula desc "foo" url "https://github.com/foo/bar.git", - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should specify a tag for git urls + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should specify a tag for git URLs revision: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" end RUBY @@ -446,7 +446,7 @@ describe RuboCop::Cop::FormulaAuditStrict::GitUrls do class Foo < Formula desc "foo" url "https://github.com/foo/bar.git", - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should specify a tag for git urls + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should specify a tag for git URLs revision: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", shallow: false end diff --git a/Library/Homebrew/test/support/fixtures/failball.rb b/Library/Homebrew/test/support/fixtures/failball.rb index e4a15344b3..1b396a721e 100644 --- a/Library/Homebrew/test/support/fixtures/failball.rb +++ b/Library/Homebrew/test/support/fixtures/failball.rb @@ -19,6 +19,6 @@ class Failball < Formula system "/usr/bin/false" if ENV["FAILBALL_BUILD_ERROR"] # This should get marshalled into a RuntimeError. - raise "something that isn't a build error happened!" + raise "Something that isn't a build error happened!" end end diff --git a/Library/Homebrew/test/utils/shell_spec.rb b/Library/Homebrew/test/utils/shell_spec.rb index 0e32d29361..8edc84c50b 100644 --- a/Library/Homebrew/test/utils/shell_spec.rb +++ b/Library/Homebrew/test/utils/shell_spec.rb @@ -82,7 +82,7 @@ describe Utils::Shell do describe "::prepend_path_in_profile" do let(:path) { "/my/path" } - it "supports Tcsh" do + it "supports tcsh" do ENV["SHELL"] = "/bin/tcsh" expect(described_class.prepend_path_in_profile(path)) .to eq("echo 'setenv PATH #{path}:$PATH' >> #{shell_profile}") @@ -94,7 +94,7 @@ describe Utils::Shell do .to eq("echo 'export PATH=\"#{path}:$PATH\"' >> #{shell_profile}") end - it "supports Fish" do + it "supports fish" do ENV["SHELL"] = "/usr/local/bin/fish" ENV["fish_user_paths"] = "/some/path" expect(described_class.prepend_path_in_profile(path)) diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index ef26b1fabb..f8c34158e2 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -16,7 +16,7 @@ module Utils which("curl"), "/usr/bin/curl", ].compact.map { |c| Pathname(c) }.find(&:executable?) - raise "no executable curl was found" unless @curl + raise "No executable curl was found" unless @curl @curl end diff --git a/Library/Homebrew/utils/pypi.rb b/Library/Homebrew/utils/pypi.rb index 0b6e3090ee..7408ac9988 100644 --- a/Library/Homebrew/utils/pypi.rb +++ b/Library/Homebrew/utils/pypi.rb @@ -32,7 +32,7 @@ module PyPI match = if package_string.start_with?(PYTHONHOSTED_URL_PREFIX) File.basename(package_string).match(/^(.+)-([a-z\d.]+?)(?:.tar.gz|.zip)$/) end - raise ArgumentError, "package should be a valid PyPI url" if match.blank? + raise ArgumentError, "package should be a valid PyPI URL" if match.blank? @name = match[1] @version = match[2] From 2ae4f11963e71b046fd4c376ff3be4a416f0a49e Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Fri, 27 Nov 2020 11:41:08 -0500 Subject: [PATCH 09/13] reorder command flags --- Library/Homebrew/cmd/--cache.rb | 1 + Library/Homebrew/cmd/deps.rb | 1 + Library/Homebrew/cmd/fetch.rb | 3 +-- Library/Homebrew/cmd/home.rb | 1 + Library/Homebrew/cmd/info.rb | 3 +-- Library/Homebrew/cmd/search.rb | 8 ++++---- Library/Homebrew/cmd/uninstall.rb | 4 ++-- Library/Homebrew/dev-cmd/audit.rb | 13 +++++-------- Library/Homebrew/dev-cmd/bump-unversioned-casks.rb | 4 ++-- Library/Homebrew/dev-cmd/cat.rb | 1 + Library/Homebrew/dev-cmd/edit.rb | 1 + Library/Homebrew/dev-cmd/livecheck.rb | 1 + Library/Homebrew/dev-cmd/typecheck.rb | 4 ++-- 13 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Library/Homebrew/cmd/--cache.rb b/Library/Homebrew/cmd/--cache.rb index 0851b3d315..aa96adf061 100644 --- a/Library/Homebrew/cmd/--cache.rb +++ b/Library/Homebrew/cmd/--cache.rb @@ -28,6 +28,7 @@ module Homebrew description: "Only show cache files for formulae." switch "--cask", description: "Only show cache files for casks." + conflicts "--build-from-source", "--force-bottle" conflicts "--formula", "--cask" diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb index 904c84bf8a..bf68924dc8 100644 --- a/Library/Homebrew/cmd/deps.rb +++ b/Library/Homebrew/cmd/deps.rb @@ -61,6 +61,7 @@ module Homebrew switch "--cask", "--casks", depends_on: "--installed", description: "Treat all named arguments as casks." + conflicts "--installed", "--all" conflicts "--formula", "--cask" formula_options diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index 9445446ed5..2005550829 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -42,12 +42,10 @@ module Homebrew switch "--[no-]quarantine", description: "Disable/enable quarantining of downloads (default: enabled).", env: :cask_opts_quarantine - switch "--formula", "--formulae", description: "Treat all named arguments as formulae." switch "--cask", "--casks", description: "Treat all named arguments as casks." - conflicts "--formula", "--cask" conflicts "--build-from-source", "--build-bottle", "--force-bottle" conflicts "--cask", "--HEAD" @@ -55,6 +53,7 @@ module Homebrew conflicts "--cask", "-s" conflicts "--cask", "--build-bottle" conflicts "--cask", "--force-bottle" + conflicts "--formula", "--cask" named_args [:formula, :cask], min: 1 end diff --git a/Library/Homebrew/cmd/home.rb b/Library/Homebrew/cmd/home.rb index fc68c63a77..125aeb8ff1 100644 --- a/Library/Homebrew/cmd/home.rb +++ b/Library/Homebrew/cmd/home.rb @@ -20,6 +20,7 @@ module Homebrew description: "Treat all named arguments as formulae." switch "--cask", "--casks", description: "Treat all named arguments as casks." + conflicts "--formula", "--cask" named_args [:formula, :cask] diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index 5c4cb54685..7d5b1f8f04 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -58,14 +58,13 @@ module Homebrew description: "Print JSON of all available formulae." switch "-v", "--verbose", description: "Show more verbose analytics data for ." - switch "--formula", "--formulae", description: "Treat all named arguments as formulae." switch "--cask", "--casks", description: "Treat all named arguments as casks." - conflicts "--formula", "--cask" conflicts "--installed", "--all" + conflicts "--formula", "--cask" named_args [:formula, :cask] end diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index c21c5255e9..6884dd8ffc 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -51,18 +51,18 @@ module Homebrew description: "Search for GitHub pull requests containing ." switch "--open", depends_on: "--pull-request", - description: "Search for only open GitHub pull requests" + description: "Search for only open GitHub pull requests." switch "--closed", depends_on: "--pull-request", - description: "Search for only closed GitHub pull requests" - conflicts "--open", "--closed" + description: "Search for only closed GitHub pull requests." package_manager_switches = PACKAGE_MANAGERS.keys.map { |name| "--#{name}" } package_manager_switches.each do |s| switch s, description: "Search for in the given package manager's list." end - conflicts("--desc", "--pull-request") + conflicts "--desc", "--pull-request" + conflicts "--open", "--closed" conflicts(*package_manager_switches) # TODO: (2.9) add `min: 1` when the `odeprecated`/`odisabled` for `brew search` with no arguments is removed diff --git a/Library/Homebrew/cmd/uninstall.rb b/Library/Homebrew/cmd/uninstall.rb index 4783bafbb2..4b1c4bead7 100644 --- a/Library/Homebrew/cmd/uninstall.rb +++ b/Library/Homebrew/cmd/uninstall.rb @@ -27,16 +27,16 @@ module Homebrew switch "--zap", description: "Remove all files associated with a . " \ "*May remove files which are shared between applications.*" - conflicts "--formula", "--zap" switch "--ignore-dependencies", description: "Don't fail uninstall, even if is a dependency of any installed "\ "formulae." - switch "--formula", "--formulae", description: "Treat all named arguments as formulae." switch "--cask", "--casks", description: "Treat all named arguments as casks." + conflicts "--formula", "--cask" + conflicts "--formula", "--zap" named_args [:installed_formula, :installed_cask], min: 1 end diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 3c5a423036..0a04c826f0 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -43,6 +43,10 @@ module Homebrew description: "Run various additional style checks to determine if a new formula or cask is eligible "\ "for Homebrew. This should be used when creating new formula and implies "\ "`--strict` and `--online`." + switch "--[no-]appcast", + description: "Audit the appcast." + switch "--token-conflicts", + description: "Audit for token conflicts." flag "--tap=", description: "Check the formulae within the given tap, specified as `/`." switch "--fix", @@ -69,25 +73,18 @@ module Homebrew comma_array "--except-cops", description: "Specify a comma-separated list to skip checking for violations of the listed "\ "RuboCop cops." - switch "--formula", "--formulae", description: "Treat all named arguments as formulae." switch "--cask", "--casks", description: "Treat all named arguments as casks." - switch "--[no-]appcast", - description: "Audit the appcast" - switch "--token-conflicts", - description: "Audit for token conflicts" - - conflicts "--formula", "--cask" - conflicts "--only", "--except" conflicts "--only-cops", "--except-cops", "--strict" conflicts "--only-cops", "--except-cops", "--only" conflicts "--display-cop-names", "--skip-style" conflicts "--display-cop-names", "--only-cops" conflicts "--display-cop-names", "--except-cops" + conflicts "--formula", "--cask" named_args [:formula, :cask] end diff --git a/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb b/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb index 97ee83ea92..bb630be684 100644 --- a/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb +++ b/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb @@ -22,8 +22,8 @@ module Homebrew EOS switch "-n", "--dry-run", description: "Do everything except caching state and opening pull requests." - flag "--limit=", - description: "Maximum runtime in minutes." + flag "--limit=", + description: "Maximum runtime in minutes." flag "--state-file=", description: "File for caching state." diff --git a/Library/Homebrew/dev-cmd/cat.rb b/Library/Homebrew/dev-cmd/cat.rb index e8c521974f..49c7cdbc10 100644 --- a/Library/Homebrew/dev-cmd/cat.rb +++ b/Library/Homebrew/dev-cmd/cat.rb @@ -19,6 +19,7 @@ module Homebrew description: "Treat all named arguments as formulae." switch "--cask", "--casks", description: "Treat all named arguments as casks." + conflicts "--formula", "--cask" named_args [:formula, :cask], number: 1 diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb index 2a1d137148..c21575b7c4 100644 --- a/Library/Homebrew/dev-cmd/edit.rb +++ b/Library/Homebrew/dev-cmd/edit.rb @@ -21,6 +21,7 @@ module Homebrew description: "Treat all named arguments as formulae." switch "--cask", "--casks", description: "Treat all named arguments as casks." + conflicts "--formula", "--cask" named_args [:formula, :cask] diff --git a/Library/Homebrew/dev-cmd/livecheck.rb b/Library/Homebrew/dev-cmd/livecheck.rb index 921ad451f5..fb61eb3656 100644 --- a/Library/Homebrew/dev-cmd/livecheck.rb +++ b/Library/Homebrew/dev-cmd/livecheck.rb @@ -44,6 +44,7 @@ module Homebrew description: "Only check formulae." switch "--cask", "--casks", description: "Only check casks." + conflicts "--debug", "--json" conflicts "--tap=", "--all", "--installed" conflicts "--cask", "--formula" diff --git a/Library/Homebrew/dev-cmd/typecheck.rb b/Library/Homebrew/dev-cmd/typecheck.rb index 62d7654ae3..3d4dc5181c 100644 --- a/Library/Homebrew/dev-cmd/typecheck.rb +++ b/Library/Homebrew/dev-cmd/typecheck.rb @@ -23,8 +23,8 @@ module Homebrew switch "--update", description: "Update RBI files." switch "--suggest-typed", - description: "Try upgrading `typed` sigils.", - depends_on: "--update" + depends_on: "--update", + description: "Try upgrading `typed` sigils." switch "--fail-if-not-changed", description: "Return a failing status code if all gems are up to date " \ "and gem definitions do not need a tapioca update." From cd3cb6928b76cffa4457957d2e6498c67c6ba84c Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Sun, 24 Jan 2021 21:25:12 -0500 Subject: [PATCH 10/13] indent suggested commands on subsequent line and combine sequential puts calls --- Library/Homebrew/build.rb | 14 +++++++---- Library/Homebrew/cask/artifact/installer.rb | 2 +- Library/Homebrew/cmd/install.rb | 24 ++++++++++++------- Library/Homebrew/dev-cmd/bump.rb | 10 ++++---- Library/Homebrew/dev-cmd/irb.rb | 10 ++++---- Library/Homebrew/dev-cmd/pr-upload.rb | 7 ++++-- Library/Homebrew/dev-cmd/update-test.rb | 6 +++-- Library/Homebrew/diagnostic.rb | 12 ++++++---- Library/Homebrew/formula_installer.rb | 12 ++++++---- Library/Homebrew/migrator.rb | 7 +++--- .../test/cask/artifact/installer_spec.rb | 2 +- Library/Homebrew/test/cask/installer_spec.rb | 2 +- Library/Homebrew/uninstall.rb | 7 ++++-- Library/Homebrew/utils/link.rb | 3 ++- 14 files changed, 76 insertions(+), 42 deletions(-) diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index 92a5c99971..6e0c581902 100644 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -153,13 +153,17 @@ class Build end if args.interactive? ohai "Entering interactive mode" - puts "Type `exit` to return and finalize the installation." - puts "Install to this prefix: #{formula.prefix}" + puts <<~EOS + Type `exit` to return and finalize the installation. + Install to this prefix: #{formula.prefix} + EOS if args.git? - puts "This directory is now a Git repo. Make your changes and then use:" - puts " git diff | pbcopy" - puts "to copy the diff to the clipboard." + puts <<~EOS + This directory is now a Git repository. Make your changes and then use: + git diff | pbcopy + to copy the diff to the clipboard. + EOS end interactive_shell(formula) diff --git a/Library/Homebrew/cask/artifact/installer.rb b/Library/Homebrew/cask/artifact/installer.rb index c2fa6543c5..b9d181d0e7 100644 --- a/Library/Homebrew/cask/artifact/installer.rb +++ b/Library/Homebrew/cask/artifact/installer.rb @@ -23,7 +23,7 @@ module Cask puts <<~EOS To complete the installation of Cask #{cask}, you must also run the installer at: - '#{cask.staged_path.join(path)}' + #{cask.staged_path.join(path)} EOS end end diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 08e7e09675..7a4b36c0a7 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -185,7 +185,8 @@ module Homebrew if !args.HEAD? && f.stable.nil? odie <<~EOS #{f.full_name} is a head-only formula - Install with `brew install --HEAD #{f.full_name}` + To install it, run: + brew install --HEAD #{f.full_name} EOS end @@ -208,14 +209,16 @@ module Homebrew optlinked_version = Keg.for(f.opt_prefix).version onoe <<~EOS #{f.full_name} #{optlinked_version} is already installed - To upgrade to #{f.version}, run `brew upgrade #{f.full_name}` + To upgrade to #{f.version}, run: + brew upgrade #{f.full_name} EOS elsif args.only_dependencies? installed_formulae << f elsif !args.quiet? opoo <<~EOS #{f.full_name} #{f.pkg_version} is already installed and up-to-date - To reinstall #{f.pkg_version}, run `brew reinstall #{f.name}` + To reinstall #{f.pkg_version}, run: + brew reinstall #{f.name} EOS end elsif (args.HEAD? && new_head_installed) || prefix_installed @@ -243,7 +246,8 @@ module Homebrew elsif !f.linked? || f.keg_only? msg = <<~EOS #{msg}, it's just not linked - You can use `brew link #{f}` to link this version. + To link this version, run: + brew link #{f} EOS elsif args.only_dependencies? msg = nil @@ -254,7 +258,8 @@ module Homebrew else <<~EOS #{msg} and up-to-date - To reinstall #{f.pkg_version}, run `brew reinstall #{f.name}` + To reinstall #{f.pkg_version}, run: + brew reinstall #{f.name} EOS end end @@ -264,7 +269,8 @@ module Homebrew if !old_formula.linked? && !old_formula.keg_only? msg = <<~EOS #{msg}, it's just not linked. - You can use `brew link #{old_formula.full_name}` to link this version. + To link this version, run: + brew link #{old_formula.full_name} EOS elsif args.quiet? msg = nil @@ -275,8 +281,10 @@ module Homebrew # but not migrated one. If --force is passed then install anyway. opoo <<~EOS #{f.oldname} is already installed, it's just not migrated - You can migrate this formula with `brew migrate #{f}` - Or you can force install it with `brew install #{f} --force` + To migrate this formula, run: + brew migrate #{f} + Or to force-install it, run: + brew install #{f} --force EOS else # If none of the above is true and the formula is linked, then diff --git a/Library/Homebrew/dev-cmd/bump.rb b/Library/Homebrew/dev-cmd/bump.rb index f9ee8b6ff8..ffbc2feab4 100644 --- a/Library/Homebrew/dev-cmd/bump.rb +++ b/Library/Homebrew/dev-cmd/bump.rb @@ -116,9 +116,11 @@ module Homebrew end ohai title - puts "Current formula version: #{current_version}" - puts "Latest Repology version: #{repology_latest}" - puts "Latest livecheck version: #{livecheck_latest}" - puts "Open pull requests: #{pull_requests}" + puts <<~EOS + Current formula version: #{current_version} + Latest Repology version: #{repology_latest} + Latest livecheck version: #{livecheck_latest} + Open pull requests: #{pull_requests} + EOS end end diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb index 2fc25c2e28..a7efb2582a 100644 --- a/Library/Homebrew/dev-cmd/irb.rb +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -40,10 +40,12 @@ module Homebrew args = irb_args.parse(ARGV.dup.freeze) if args.examples? - puts "'v8'.f # => instance of the v8 formula" - puts ":hub.f.latest_version_installed?" - puts ":lua.f.methods - 1.methods" - puts ":mpd.f.recursive_dependencies.reject(&:installed?)" + puts <<~EOS + 'v8'.f # => instance of the v8 formula + :hub.f.latest_version_installed? + :lua.f.methods - 1.methods + :mpd.f.recursive_dependencies.reject(&:installed?) + EOS return end diff --git a/Library/Homebrew/dev-cmd/pr-upload.rb b/Library/Homebrew/dev-cmd/pr-upload.rb index a710ab7a96..09fb40e08c 100644 --- a/Library/Homebrew/dev-cmd/pr-upload.rb +++ b/Library/Homebrew/dev-cmd/pr-upload.rb @@ -81,8 +81,11 @@ module Homebrew else "Bintray" end - puts "brew #{bottle_args.join " "}" - puts "Upload bottles described by these JSON files to #{service}:\n #{json_files.join("\n ")}" + puts <<~EOS + brew #{bottle_args.join " "} + Upload bottles described by these JSON files to #{service}: + #{json_files.join("\n ")} + EOS return end diff --git a/Library/Homebrew/dev-cmd/update-test.rb b/Library/Homebrew/dev-cmd/update-test.rb index 3d8063a569..227ea0a9c7 100644 --- a/Library/Homebrew/dev-cmd/update-test.rb +++ b/Library/Homebrew/dev-cmd/update-test.rb @@ -95,8 +95,10 @@ module Homebrew end end - puts "Start commit: #{start_commit}" - puts " End commit: #{end_commit}" + puts <<~EOS + Start commit: #{start_commit} + End commit: #{end_commit} + EOS mkdir "update-test" chdir "update-test" do diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 60ac07a04a..6f26f2db8d 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -335,7 +335,8 @@ module Homebrew <<~EOS #{HOMEBREW_TEMP} is world-writable but does not have the sticky bit set. - Please execute `sudo chmod +t #{HOMEBREW_TEMP}` in your Terminal. + To set it, run the following command: + sudo chmod +t #{HOMEBREW_TEMP} EOS end alias generic_check_tmpdir_sticky_bit check_tmpdir_sticky_bit @@ -897,7 +898,8 @@ module Homebrew <<~EOS The staging path #{user_tilde(path.to_s)} is not writable by the current user. - To fix, run \'sudo chown -R $(whoami):staff #{user_tilde(path.to_s)}' + To fix, run: + sudo chown -R $(whoami):staff #{user_tilde(path.to_s)} EOS end @@ -970,12 +972,14 @@ module Homebrew if result.include? "Python 2.7" <<~EOS Your Python installation has a broken version of setuptools. - To fix, reinstall macOS or run 'sudo /usr/bin/python -m pip install -I setuptools'. + To fix, reinstall macOS or run: + sudo /usr/bin/python -m pip install -I setuptools EOS else <<~EOS The system Python version is wrong. - To fix, run 'defaults write com.apple.versioner.python Version 2.7'. + To fix, run: + defaults write com.apple.versioner.python Version 2.7 EOS end elsif result.stderr.include? "pkg_resources.DistributionNotFound" diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index dd2e64d76d..8722df1f67 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -362,14 +362,16 @@ class FormulaInstaller EOS if formula.outdated? && !formula.head? message += <<~EOS - To upgrade to #{formula.pkg_version}, run `brew upgrade #{formula.full_name}`. + To upgrade to #{formula.pkg_version}, run: + brew upgrade #{formula.full_name} EOS elsif only_deps? message = nil else # some other version is already installed *and* linked message += <<~EOS - To install #{formula.pkg_version}, first run `brew unlink #{formula.name}`. + To install #{formula.pkg_version}, first run: + brew unlink #{formula.name} EOS end raise CannotInstallFormulaError, message if message @@ -805,7 +807,8 @@ class FormulaInstaller if build_bottle? ohai "Not running post_install as we're building a bottle" - puts "You can run it manually using `brew postinstall #{formula.full_name}`" + puts "You can run it manually using:" + puts " brew postinstall #{formula.full_name}" else post_install end @@ -1097,7 +1100,8 @@ class FormulaInstaller end rescue Exception => e # rubocop:disable Lint/RescueException opoo "The post-install step did not complete successfully" - puts "You can try again using `brew postinstall #{formula.full_name}`" + puts "You can try again using:" + puts " brew postinstall #{formula.full_name}" odebug e, e.backtrace, always_display: Homebrew::EnvConfig.developer? Homebrew.failed = true @show_summary_heading = true diff --git a/Library/Homebrew/migrator.rb b/Library/Homebrew/migrator.rb index e065a2de63..67bff176ad 100644 --- a/Library/Homebrew/migrator.rb +++ b/Library/Homebrew/migrator.rb @@ -17,8 +17,8 @@ class Migrator class MigrationNeededError < RuntimeError def initialize(formula) super <<~EOS - #{formula.oldname} was renamed to #{formula.name} and needs to be migrated. - Please run `brew migrate #{formula.oldname}` + #{formula.oldname} was renamed to #{formula.name} and needs to be migrated by running: + brew migrate #{formula.oldname} EOS end end @@ -48,7 +48,8 @@ class Migrator super <<~EOS #{formula.name} from #{formula.tap} is given, but old name #{formula.oldname} was installed from #{tap || "path or url"}. - #{msg}To force migration use `brew migrate --force #{formula.oldname}`. + #{msg}To force migration, run: + brew migrate --force #{formula.oldname} EOS end end diff --git a/Library/Homebrew/test/cask/artifact/installer_spec.rb b/Library/Homebrew/test/cask/artifact/installer_spec.rb index 1feb893391..7f47a31d9c 100644 --- a/Library/Homebrew/test/cask/artifact/installer_spec.rb +++ b/Library/Homebrew/test/cask/artifact/installer_spec.rb @@ -18,7 +18,7 @@ describe Cask::Artifact::Installer, :cask do it "shows a message prompting to run the installer manually" do expect { installer.install_phase(command: command) - }.to output(%r{run the installer at:\s+'#{staged_path}/installer'}).to_stdout + }.to output(%r{run the installer at:\s+#{staged_path}/installer}).to_stdout end end diff --git a/Library/Homebrew/test/cask/installer_spec.rb b/Library/Homebrew/test/cask/installer_spec.rb index 6a9a1bc67a..f205bd7074 100644 --- a/Library/Homebrew/test/cask/installer_spec.rb +++ b/Library/Homebrew/test/cask/installer_spec.rb @@ -119,7 +119,7 @@ describe Cask::Installer, :cask do ==> Installing Cask with-installer-manual To complete the installation of Cask with-installer-manual, you must also run the installer at: - '#{with_installer_manual.staged_path.join("Caffeine.app")}' + #{with_installer_manual.staged_path.join("Caffeine.app")} 🍺 with-installer-manual was successfully installed! EOS ).to_stdout diff --git a/Library/Homebrew/uninstall.rb b/Library/Homebrew/uninstall.rb index 156d74478e..cabb18f627 100644 --- a/Library/Homebrew/uninstall.rb +++ b/Library/Homebrew/uninstall.rb @@ -50,8 +50,11 @@ module Homebrew if rack.directory? versions = rack.subdirs.map(&:basename) - puts "#{keg.name} #{versions.to_sentence} #{"is".pluralize(versions.count)} still installed." - puts "Run `brew uninstall --force #{keg.name}` to remove all versions." + puts <<~EOS + #{keg.name} #{versions.to_sentence} #{"is".pluralize(versions.count)} still installed. + To remove all versions, run: + brew uninstall --force #{keg.name} + EOS end next unless f diff --git a/Library/Homebrew/utils/link.rb b/Library/Homebrew/utils/link.rb index 8078390f60..c33d5ca335 100644 --- a/Library/Homebrew/utils/link.rb +++ b/Library/Homebrew/utils/link.rb @@ -36,7 +36,8 @@ module Utils Could not link: #{conflicts.join("\n")} - Please delete these paths and run `#{command}`. + Please delete these paths and run: + #{command} EOS end private_class_method :link_src_dst_dirs From 2ed324ebc09b18df4032204053e61baf56413980 Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Sun, 24 Jan 2021 21:40:41 -0500 Subject: [PATCH 11/13] use backticks around suggested input, flags, and binaries --- Library/Homebrew/cask/artifact/pkg.rb | 2 +- Library/Homebrew/cask/cmd.rb | 2 +- Library/Homebrew/cask/installer.rb | 2 +- Library/Homebrew/cask/quarantine.rb | 2 +- Library/Homebrew/cmd/cleanup.rb | 2 +- Library/Homebrew/cmd/install.rb | 2 +- Library/Homebrew/cmd/link.rb | 2 +- Library/Homebrew/cmd/outdated.rb | 8 ++++---- Library/Homebrew/cmd/search.rb | 2 +- Library/Homebrew/dev-cmd/bottle.rb | 6 +++--- Library/Homebrew/dev-cmd/bump-cask-pr.rb | 2 +- Library/Homebrew/dev-cmd/bump-formula-pr.rb | 10 +++++----- Library/Homebrew/dev-cmd/irb.rb | 2 +- Library/Homebrew/dev-cmd/pr-publish.rb | 2 +- Library/Homebrew/dev-cmd/pr-pull.rb | 2 +- Library/Homebrew/dev-cmd/update-test.rb | 4 ++-- Library/Homebrew/diagnostic.rb | 4 ++-- Library/Homebrew/env_config.rb | 2 +- Library/Homebrew/formula_cellar_checks.rb | 4 ++-- Library/Homebrew/formulary.rb | 4 ++-- Library/Homebrew/os/linux/elf.rb | 2 +- Library/Homebrew/test/dev-cmd/bottle_spec.rb | 2 +- Library/Homebrew/utils/curl.rb | 2 +- 23 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Library/Homebrew/cask/artifact/pkg.rb b/Library/Homebrew/cask/artifact/pkg.rb index 8099865081..dd3a9447bf 100644 --- a/Library/Homebrew/cask/artifact/pkg.rb +++ b/Library/Homebrew/cask/artifact/pkg.rb @@ -40,7 +40,7 @@ module Cask def run_installer(command: nil, verbose: false, **_options) ohai "Running installer for #{cask}; your password may be necessary.", - "Package installers may write to any location; options such as --appdir are ignored." + "Package installers may write to any location; options such as `--appdir` are ignored." unless path.exist? pkg = path.relative_path_from(cask.staged_path) pkgs = Pathname.glob(cask.staged_path/"**"/"*.pkg").map { |path| path.relative_path_from(cask.staged_path) } diff --git a/Library/Homebrew/cask/cmd.rb b/Library/Homebrew/cask/cmd.rb index 0d6cd171bf..5a66b23caf 100644 --- a/Library/Homebrew/cask/cmd.rb +++ b/Library/Homebrew/cask/cmd.rb @@ -174,7 +174,7 @@ module Cask [args.remaining.empty? ? NullCommand : UnknownSubcommand.new(args.remaining.first), argv] if (replacement = DEPRECATED_COMMANDS[command]) - odisabled "brew cask #{command.command_name}", replacement + odisabled "`brew cask #{command.command_name}`", replacement end if args.help? diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index bd4cbd6aa9..c8f0ad3bc3 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -482,7 +482,7 @@ module Cask end def zap - ohai %Q(Implied "brew uninstall --cask #{@cask}") + ohai "Implied `brew uninstall --cask #{@cask}`" uninstall_artifacts if (zap_stanzas = @cask.artifacts.select { |a| a.is_a?(Artifact::Zap) }).empty? opoo "No zap stanza present for Cask '#{@cask}'" diff --git a/Library/Homebrew/cask/quarantine.rb b/Library/Homebrew/cask/quarantine.rb index de24b35d33..f0c60ac038 100644 --- a/Library/Homebrew/cask/quarantine.rb +++ b/Library/Homebrew/cask/quarantine.rb @@ -32,7 +32,7 @@ module Cask odebug "Checking quarantine support" if !system_command(xattr, print_stderr: false).success? - odebug "There's not a working version of xattr." + odebug "There's no working version of `xattr` on this system." :xattr_broken elsif swift.nil? odebug "Swift is not available on this system." diff --git a/Library/Homebrew/cmd/cleanup.rb b/Library/Homebrew/cmd/cleanup.rb index 404ca2b5f7..06123b915f 100644 --- a/Library/Homebrew/cmd/cleanup.rb +++ b/Library/Homebrew/cmd/cleanup.rb @@ -45,7 +45,7 @@ module Homebrew when "all" 0 else - raise UsageError, "--prune= expects an integer or 'all'." + raise UsageError, "`--prune=` expects an integer or `all`." end end diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 7a4b36c0a7..15d9bb4b80 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -146,7 +146,7 @@ module Homebrew if args.ignore_dependencies? opoo <<~EOS - #{Tty.bold}--ignore-dependencies is an unsupported Homebrew developer flag!#{Tty.reset} + #{Tty.bold}`--ignore-dependencies` is an unsupported Homebrew developer flag!#{Tty.reset} Adjust your PATH to put any preferred versions of applications earlier in the PATH rather than using this unsupported flag! diff --git a/Library/Homebrew/cmd/link.rb b/Library/Homebrew/cmd/link.rb index 5093666b8b..6db1324d2e 100644 --- a/Library/Homebrew/cmd/link.rb +++ b/Library/Homebrew/cmd/link.rb @@ -86,7 +86,7 @@ module Homebrew end if !args.force? && (formula.blank? || !formula.keg_only_reason.versioned_formula?) - opoo "#{keg.name} is keg-only and must be linked with --force" + opoo "#{keg.name} is keg-only and must be linked with `--force`." puts_keg_only_path_message(keg) next end diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb index 8abd45ec58..004bc3a1eb 100644 --- a/Library/Homebrew/cmd/outdated.rb +++ b/Library/Homebrew/cmd/outdated.rb @@ -28,9 +28,9 @@ module Homebrew switch "--cask", description: "List only outdated casks." flag "--json", - description: "Print output in JSON format. There are two versions: v1 and v2. " \ - "v1 is deprecated and is currently the default if no version is specified. " \ - "v2 prints outdated formulae and casks. " + description: "Print output in JSON format. There are two versions: `v1` and `v2`. " \ + "`v1` is deprecated and is currently the default if no version is specified. " \ + "`v2` prints outdated formulae and casks. " switch "--fetch-HEAD", description: "Fetch the upstream repository to detect if the HEAD installation of the "\ "formula is outdated. Otherwise, the repository's HEAD will only be checked for "\ @@ -50,7 +50,7 @@ module Homebrew case (j = json_version(args.json)) when :v1 - odisabled "brew outdated --json#{j == :v1 ? "=v1" : ""}", "brew outdated --json=v2" + odisabled "`brew outdated --json#{j == :v1 ? "=v1" : ""}`", "`brew outdated --json=v2`" when :v2, :default formulae, casks = if args.formula? [outdated_formulae(args: args), []] diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 6884dd8ffc..d5c86658e0 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -85,7 +85,7 @@ module Homebrew puts Formatter.columns(Cask::Cask.to_a.map(&:full_name).sort) else - odeprecated "'brew search' with no arguments to output formulae", "'brew formulae'" + odeprecated "`brew search` with no arguments to output formulae", "`brew formulae`" puts Formatter.columns(Formula.full_names.sort) end diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 654bea0052..cd3f928829 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -400,7 +400,7 @@ module Homebrew end odie <<~EOS - --keep-old was passed but there are changes in: + `--keep-old` was passed but there are changes in: #{mismatches.join("\n")} EOS end @@ -566,7 +566,7 @@ module Homebrew def old_checksums(formula, formula_ast, bottle_hash, args:) bottle_node = formula_ast.bottle_block if bottle_node.nil? - odie "--keep-old was passed but there was no existing bottle block!" if args.keep_old? + odie "`--keep-old` was passed but there was no existing bottle block!" if args.keep_old? return end return [] unless args.keep_old? @@ -576,7 +576,7 @@ module Homebrew mismatches, checksums = merge_bottle_spec(old_keys, old_bottle_spec, bottle_hash["bottle"]) if mismatches.present? odie <<~EOS - --keep-old was passed but there are changes in: + `--keep-old` was passed but there are changes in: #{mismatches.join("\n")} EOS end diff --git a/Library/Homebrew/dev-cmd/bump-cask-pr.rb b/Library/Homebrew/dev-cmd/bump-cask-pr.rb index 3c55907f57..406f16cd13 100644 --- a/Library/Homebrew/dev-cmd/bump-cask-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-cask-pr.rb @@ -113,7 +113,7 @@ module Homebrew if new_version.present? if new_version.latest? - opoo "Ignoring specified --sha256= argument." if new_hash.present? + opoo "Ignoring specified `--sha256=` argument." if new_hash.present? new_hash = :no_check elsif new_hash.nil? || cask.languages.present? tmp_contents = Utils::Inreplace.inreplace_pairs(cask.sourcefile_path, diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 896a57937e..7938e51920 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -196,7 +196,7 @@ module Homebrew new_revision = Utils.popen_read("git -C \"#{resource_path}\" rev-parse -q --verify HEAD") new_revision = new_revision.strip elsif new_revision.blank? - odie "#{formula}: the current URL requires specifying a --revision= argument." + odie "#{formula}: the current URL requires specifying a `--revision=` argument." end false elsif new_url.blank? && new_version.blank? @@ -424,11 +424,11 @@ module Homebrew return if new_mirrors.present? || old_mirrors.empty? if args.force? - opoo "#{formula}: Removing all mirrors because a --mirror= argument was not specified." + opoo "#{formula}: Removing all mirrors because a `--mirror=` argument was not specified." else odie <<~EOS - #{formula}: a --mirror= argument for updating the mirror URL(s) was not specified. - Use --force to remove all mirrors. + #{formula}: a `--mirror=` argument for updating the mirror URL(s) was not specified. + Use `--force` to remove all mirrors. EOS end end @@ -439,7 +439,7 @@ module Homebrew resource.owner = Resource.new(formula.name) forced_version = new_version && new_version != resource.version resource.version = new_version if forced_version - odie "No --version= argument specified!" if resource.version.blank? + odie "No `--version=` argument specified!" if resource.version.blank? [resource.fetch, forced_version] end diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb index a7efb2582a..3f032038be 100644 --- a/Library/Homebrew/dev-cmd/irb.rb +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -61,7 +61,7 @@ module Homebrew require "keg" require "cask" - ohai "Interactive Homebrew Shell", "Example commands available with: brew irb --examples" + ohai "Interactive Homebrew Shell", "Example commands available with: `brew irb --examples`" if args.pry? Pry.start else diff --git a/Library/Homebrew/dev-cmd/pr-publish.rb b/Library/Homebrew/dev-cmd/pr-publish.rb index 82876b9c63..4f068d7ad6 100644 --- a/Library/Homebrew/dev-cmd/pr-publish.rb +++ b/Library/Homebrew/dev-cmd/pr-publish.rb @@ -49,7 +49,7 @@ module Homebrew _, user, repo, issue = *url_match odie "Not a GitHub pull request: #{arg}" unless issue if args.tap.present? && !"#{user}/#{repo}".casecmp(tap.full_name).zero? - odie "Pull request URL is for #{user}/#{repo} but --tap=#{tap.full_name}!" + odie "Pull request URL is for #{user}/#{repo} but `--tap=#{tap.full_name}` was specified!" end ohai "Dispatching #{tap} pull request ##{issue}" diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb index fbf1a3c266..287b8ccbee 100644 --- a/Library/Homebrew/dev-cmd/pr-pull.rb +++ b/Library/Homebrew/dev-cmd/pr-pull.rb @@ -414,7 +414,7 @@ module Homebrew workflow_run.first.blank? # Ignore that workflow as it was not executed and we specified # that we could skip it. - ohai "Ignoring workflow #{workflow} as requested by --ignore-missing-artifacts" + ohai "Ignoring workflow #{workflow} as requested by `--ignore-missing-artifacts`" next end diff --git a/Library/Homebrew/dev-cmd/update-test.rb b/Library/Homebrew/dev-cmd/update-test.rb index 227ea0a9c7..55e4a41082 100644 --- a/Library/Homebrew/dev-cmd/update-test.rb +++ b/Library/Homebrew/dev-cmd/update-test.rb @@ -129,7 +129,7 @@ module Homebrew quiet_system "brew", "help" # run brew update - oh1 "Running brew update..." + oh1 "Running `brew update`..." safe_system "brew", "update", "--verbose", "--debug" actual_end_commit = Utils.popen_read("git", "rev-parse", branch).chomp if actual_end_commit != end_commit @@ -137,7 +137,7 @@ module Homebrew end_log = Utils.popen_read("git", "log", "-1", "--decorate", "--oneline", end_commit).chomp actual_log = Utils.popen_read("git", "log", "-1", "--decorate", "--oneline", actual_end_commit).chomp odie <<~EOS - brew update didn't update #{branch}! + `brew update` didn't update #{branch}! Start commit: #{start_log} Expected end commit: #{end_log} Actual end commit: #{actual_log} diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 6f26f2db8d..8a07057222 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -983,7 +983,7 @@ module Homebrew EOS end elsif result.stderr.include? "pkg_resources.DistributionNotFound" - "Your Python installation is unable to find xattr." + "Your Python installation is unable to find `xattr`." else "unknown xattr error: #{result.stderr.split("\n").last}" end @@ -994,7 +994,7 @@ module Homebrew when :quarantine_available nil when :xattr_broken - "There's not a working version of xattr." + "There's no working version of `xattr` on this system." when :no_swift "Swift is not available on this system." when :no_quarantine diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb index 81d5992d87..a767c1c8f8 100644 --- a/Library/Homebrew/env_config.rb +++ b/Library/Homebrew/env_config.rb @@ -241,7 +241,7 @@ module Homebrew HOMEBREW_NO_INSTALL_CLEANUP: { description: "If set, `brew install`, `brew upgrade` and `brew reinstall` will never automatically " \ "cleanup installed/upgraded/reinstalled formulae or all formulae every " \ - "HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS days.", + "`HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS` days.", boolean: true, }, HOMEBREW_PRY: { diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb index f896caaf47..e243c24750 100644 --- a/Library/Homebrew/formula_cellar_checks.rb +++ b/Library/Homebrew/formula_cellar_checks.rb @@ -31,7 +31,7 @@ module FormulaCellarChecks <<~EOS A top-level "man" directory was found Homebrew requires that man pages live under share. - This can often be fixed by passing "--mandir=\#{man}" to configure. + This can often be fixed by passing `--mandir=\#{man}` to `configure`. EOS end @@ -42,7 +42,7 @@ module FormulaCellarChecks <<~EOS A top-level "info" directory was found Homebrew suggests that info pages live under share. - This can often be fixed by passing "--infodir=\#{info}" to configure. + This can often be fixed by passing `--infodir=\#{info}` to `configure`. EOS end diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 28e3864742..52f18dbef7 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -225,10 +225,10 @@ module Formulary def load_file(flags:) if %r{githubusercontent.com/[\w-]+/[\w-]+/[a-f0-9]{40}(?:/Formula)?/(?[\w+-.@]+).rb} =~ url # rubocop:disable Style/CaseLikeIf raise UsageError, "Installation of #{formula_name} from a GitHub commit URL is unsupported! " \ - "'brew extract #{formula_name}' to stable tap on GitHub instead." + "`brew extract #{formula_name}` to a stable tap on GitHub instead." elsif url.match?(%r{^(https?|ftp)://}) raise UsageError, "Non-checksummed download of #{name} formula file from an arbitrary URL is unsupported! ", - "'brew extract' or 'brew create' and 'brew tap-new' to create a "\ + "`brew extract` or `brew create` and `brew tap-new` to create a "\ "formula file in a tap on GitHub instead." end HOMEBREW_CACHE_FORMULA.mkpath diff --git a/Library/Homebrew/os/linux/elf.rb b/Library/Homebrew/os/linux/elf.rb index e8009af519..f31a40f806 100644 --- a/Library/Homebrew/os/linux/elf.rb +++ b/Library/Homebrew/os/linux/elf.rb @@ -160,7 +160,7 @@ module ELFShim def save_using_patchelf(new_interpreter, new_rpath) patchelf = DevelopmentTools.locate "patchelf" - odie "Could not locate patchelf, please: brew install patchelf." if patchelf.blank? + odie "Could not locate `patchelf`; please run `brew install patchelf`" if patchelf.blank? args = [] args << "--set-interpreter" << new_interpreter if new_interpreter.present? args << "--force-rpath" << "--set-rpath" << new_rpath if new_rpath.present? diff --git a/Library/Homebrew/test/dev-cmd/bottle_spec.rb b/Library/Homebrew/test/dev-cmd/bottle_spec.rb index baceed730a..34d3bf8ccc 100644 --- a/Library/Homebrew/test/dev-cmd/bottle_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bottle_spec.rb @@ -411,7 +411,7 @@ describe "brew bottle --merge", :integration_test, :needs_linux do "--keep-old", "#{TEST_TMPDIR}/testball-1.0.big_sur.bottle.json", "#{TEST_TMPDIR}/testball-1.0.catalina.bottle.json" - }.to output("Error: --keep-old was passed but there was no existing bottle block!\n").to_stderr + }.to output("Error: `--keep-old` was passed but there was no existing bottle block!\n").to_stderr end it "updates the bottle block in a formula that already has a bottle block when using --keep-old" do diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index f8c34158e2..a6ced92316 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -16,7 +16,7 @@ module Utils which("curl"), "/usr/bin/curl", ].compact.map { |c| Pathname(c) }.find(&:executable?) - raise "No executable curl was found" unless @curl + raise "No executable `curl` was found" unless @curl @curl end From 99ad3350ee06b22a04780cd0d582a40f62f7cf2b Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Sun, 24 Jan 2021 21:55:35 -0500 Subject: [PATCH 12/13] use single quotes around stanza and parameter names --- Library/Homebrew/cask/audit.rb | 4 ++-- Library/Homebrew/cask/cmd/upgrade.rb | 2 +- Library/Homebrew/exceptions.rb | 13 +++++++------ Library/Homebrew/extend/on_os.rb | 4 ++-- Library/Homebrew/extend/os/linux/on_os.rb | 2 +- Library/Homebrew/extend/os/mac/on_os.rb | 2 +- Library/Homebrew/formula_auditor.rb | 10 +++++----- Library/Homebrew/formula_installer.rb | 2 +- Library/Homebrew/software_spec.rb | 2 +- Library/Homebrew/test/cask/audit_spec.rb | 2 +- Library/Homebrew/utils/ast.rb | 2 +- 11 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index da142f6820..4d20b6a909 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -416,7 +416,7 @@ module Cask return unless verified_matches_url? add_error "The URL's domain #{domain} matches the homepage domain #{homepage}, " \ - "the `verified` parameter of the `url` stanza is unnecessary. " \ + "the 'verified' parameter of the 'url' stanza is unnecessary. " \ "See https://github.com/Homebrew/homebrew-cask/blob/master/doc/cask_language_reference/stanzas/url.md#when-url-and-homepage-hostnames-differ-add-verified" end @@ -427,7 +427,7 @@ module Cask return if verified_present? add_error "The URL's domain #{domain} does not match the homepage domain #{homepage}, " \ - "a `verified` parameter has to be added to the `url` stanza. " \ + "a 'verified' parameter has to be added to the 'url' stanza. " \ "See https://github.com/Homebrew/homebrew-cask/blob/master/doc/cask_language_reference/stanzas/url.md#when-url-and-homepage-hostnames-differ-add-verified" end diff --git a/Library/Homebrew/cask/cmd/upgrade.rb b/Library/Homebrew/cask/cmd/upgrade.rb index 3d711f4a82..a0d0ecb98c 100644 --- a/Library/Homebrew/cask/cmd/upgrade.rb +++ b/Library/Homebrew/cask/cmd/upgrade.rb @@ -101,7 +101,7 @@ module Cask return false if outdated_casks.empty? if casks.empty? && !greedy - ohai "Casks with `auto_updates` or `version :latest` will not be upgraded; pass `--greedy` to upgrade them." + ohai "Casks with 'auto_updates' or 'version :latest' will not be upgraded; pass `--greedy` to upgrade them." end verb = dry_run ? "Would upgrade" : "Upgrading" diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 2ae9494b99..3c277e20c4 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -384,8 +384,8 @@ class FormulaUnknownPythonError < RuntimeError The version of Python to use with the virtualenv in the `#{formula.full_name}` formula cannot be guessed automatically because a recognised Python dependency could not be found. - If you are using a non-standard Python depedency, please add `:using => "python@x.y"` to - `virtualenv_install_with_resources` to resolve the issue manually. + If you are using a non-standard Python dependency, please add `:using => "python@x.y"` + to 'virtualenv_install_with_resources' to resolve the issue manually. EOS end end @@ -394,10 +394,11 @@ end class FormulaAmbiguousPythonError < RuntimeError def initialize(formula) super <<~EOS - The version of python to use with the virtualenv in the `#{formula.full_name}` formula - cannot be guessed automatically. If the simultaneous use of multiple pythons - is intentional, please add `:using => "python@x.y"` to - `virtualenv_install_with_resources` to resolve the ambiguity manually. + The version of Python to use with the virtualenv in the `#{formula.full_name}` formula + cannot be guessed automatically. + + If the simultaneous use of multiple Pythons is intentional, please add `:using => "python@x.y"` + to 'virtualenv_install_with_resources' to resolve the ambiguity manually. EOS end end diff --git a/Library/Homebrew/extend/on_os.rb b/Library/Homebrew/extend/on_os.rb index a30a241d3b..5bf551fe59 100644 --- a/Library/Homebrew/extend/on_os.rb +++ b/Library/Homebrew/extend/on_os.rb @@ -7,7 +7,7 @@ module OnOS # # Do something Mac-specific # end def on_macos(&block) - raise "No block content defined for on_macos block" unless block + raise "No block content defined for 'on_macos' block" unless block end # Block only executed on Linux. No-op on macOS. @@ -15,7 +15,7 @@ module OnOS # # Do something Linux-specific # end def on_linux(&block) - raise "No block content defined for on_linux block" unless block + raise "No block content defined for 'on_linux' block" unless block end end diff --git a/Library/Homebrew/extend/os/linux/on_os.rb b/Library/Homebrew/extend/os/linux/on_os.rb index d1bbbab734..433d8b111b 100644 --- a/Library/Homebrew/extend/os/linux/on_os.rb +++ b/Library/Homebrew/extend/os/linux/on_os.rb @@ -3,7 +3,7 @@ module OnOS def on_linux(&block) - raise "No block content defined for on_linux block" unless block + raise "No block content defined for 'on_linux' block" unless block yield end diff --git a/Library/Homebrew/extend/os/mac/on_os.rb b/Library/Homebrew/extend/os/mac/on_os.rb index f043909555..e3f71dbd10 100644 --- a/Library/Homebrew/extend/os/mac/on_os.rb +++ b/Library/Homebrew/extend/os/mac/on_os.rb @@ -3,7 +3,7 @@ module OnOS def on_macos(&block) - raise "No block content defined for on_macos block" unless block + raise "No block content defined for 'on_macos' block" unless block yield end diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index 68deb02245..0925fb3182 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -221,13 +221,13 @@ module Homebrew # Don't complain about missing cross-tap dependencies next rescue FormulaUnavailableError - problem "Can't find dependency #{dep.name.inspect}." + problem "Can't find dependency '#{dep.name.inspect}'." next rescue TapFormulaAmbiguityError - problem "Ambiguous dependency #{dep.name.inspect}." + problem "Ambiguous dependency '#{dep.name.inspect}'." next rescue TapFormulaWithOldnameAmbiguityError - problem "Ambiguous oldname dependency #{dep.name.inspect}." + problem "Ambiguous oldname dependency '#{dep.name.inspect}'." next end @@ -258,10 +258,10 @@ module Homebrew end end - problem "Dependency #{dep} does not define option #{opt.name.inspect}" + problem "Dependency '#{dep}' does not define option #{opt.name.inspect}" end - problem "Don't use git as a dependency (it's always available)" if @new_formula && dep.name == "git" + problem "Don't use 'git' as a dependency (it's always available)" if @new_formula && dep.name == "git" problem "Dependency '#{dep.name}' is marked as :run. Remove :run; it is a no-op." if dep.tags.include?(:run) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 8722df1f67..510a7f4e46 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -806,7 +806,7 @@ class FormulaInstaller fix_dynamic_linkage(keg) if !@poured_bottle || !formula.bottle_specification.skip_relocation? if build_bottle? - ohai "Not running post_install as we're building a bottle" + ohai "Not running 'post_install' as we're building a bottle" puts "You can run it manually using:" puts " brew postinstall #{formula.full_name}" else diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 1d029e2aab..6512856afa 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -356,7 +356,7 @@ class BottleSpecification if [HOMEBREW_DEFAULT_PREFIX, HOMEBREW_MACOS_ARM_DEFAULT_PREFIX, HOMEBREW_LINUX_DEFAULT_PREFIX].exclude?(prefix) - odeprecated "setting `prefix` for bottles" + odeprecated "setting 'prefix' for bottles" end @prefix = prefix end diff --git a/Library/Homebrew/test/cask/audit_spec.rb b/Library/Homebrew/test/cask/audit_spec.rb index 6303db5ae9..4912e3885a 100644 --- a/Library/Homebrew/test/cask/audit_spec.rb +++ b/Library/Homebrew/test/cask/audit_spec.rb @@ -917,7 +917,7 @@ describe Cask::Audit, :cask do RUBY end - it { is_expected.to fail_with(/a `verified` parameter has to be added/) } + it { is_expected.to fail_with(/a 'verified' parameter has to be added/) } end context "when the url does not match the homepage with verified" do diff --git a/Library/Homebrew/utils/ast.rb b/Library/Homebrew/utils/ast.rb index fc320039e0..bc4e389b23 100644 --- a/Library/Homebrew/utils/ast.rb +++ b/Library/Homebrew/utils/ast.rb @@ -117,7 +117,7 @@ module Utils sig { params(name: Symbol, replacement: T.any(Numeric, String, Symbol), type: T.nilable(Symbol)).void } def replace_stanza(name, replacement, type: nil) stanza_node = stanza(name, type: type) - raise "Could not find `#{name}` stanza!" if stanza_node.blank? + raise "Could not find '#{name}' stanza!" if stanza_node.blank? tree_rewriter.replace(stanza_node.source_range, stanza_text(name, replacement, indent: 2).lstrip) end From 6fc116318e53cc8dae1460a0896026399a75e383 Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Tue, 26 Jan 2021 15:21:24 -0500 Subject: [PATCH 13/13] fixes for grammar and wording --- Library/Homebrew/build.rb | 2 +- .../cask/artifact/abstract_uninstall.rb | 4 +- Library/Homebrew/cask/artifact/moved.rb | 6 +-- Library/Homebrew/cask/artifact/relocated.rb | 2 +- Library/Homebrew/cask/artifact/symlinked.rb | 4 +- Library/Homebrew/cask/cask_loader.rb | 2 +- Library/Homebrew/cask/cmd/abstract_command.rb | 2 +- Library/Homebrew/cask/cmd/internal_stanza.rb | 2 +- Library/Homebrew/cask/download.rb | 2 +- Library/Homebrew/cask/dsl.rb | 4 +- Library/Homebrew/cask/dsl/caveats.rb | 2 +- Library/Homebrew/cask/dsl/container.rb | 2 +- Library/Homebrew/cask/dsl/depends_on.rb | 2 +- Library/Homebrew/cask/installer.rb | 2 +- Library/Homebrew/cask/metadata.rb | 4 +- Library/Homebrew/cask/staged.rb | 2 +- Library/Homebrew/caveats.rb | 2 +- Library/Homebrew/cmd/fetch.rb | 2 +- Library/Homebrew/cmd/install.rb | 24 ++++++----- Library/Homebrew/cmd/link.rb | 2 +- Library/Homebrew/cmd/log.rb | 2 +- Library/Homebrew/cmd/update-report.rb | 6 +-- Library/Homebrew/cmd/update.sh | 4 +- Library/Homebrew/cmd/vendor-install.sh | 2 +- Library/Homebrew/config.rb | 2 +- Library/Homebrew/dev-cmd/bump-formula-pr.rb | 2 +- Library/Homebrew/dev-cmd/edit.rb | 2 +- Library/Homebrew/dev-cmd/man.rb | 2 +- Library/Homebrew/dev-cmd/unbottled.rb | 11 ++--- Library/Homebrew/diagnostic.rb | 24 +++++------ Library/Homebrew/env_config.rb | 4 +- Library/Homebrew/extend/ENV/shared.rb | 4 +- Library/Homebrew/formula_cellar_checks.rb | 42 +++++++++---------- Library/Homebrew/formula_installer.rb | 6 +-- Library/Homebrew/keg.rb | 2 +- Library/Homebrew/manpages/brew.1.md.erb | 2 +- Library/Homebrew/missing_formula.rb | 6 +-- Library/Homebrew/os/mac/xcode.rb | 2 +- Library/Homebrew/resource.rb | 2 +- Library/Homebrew/shims/linux/super/make | 2 +- Library/Homebrew/system_command.rb | 2 +- .../Homebrew/test/cask/artifact/app_spec.rb | 12 +++--- .../Homebrew/test/cask/cmd/install_spec.rb | 4 +- .../Homebrew/test/cask/cmd/reinstall_spec.rb | 6 +-- .../Homebrew/test/cask/cmd/uninstall_spec.rb | 4 +- .../Homebrew/test/diagnostic_checks_spec.rb | 4 +- Library/Homebrew/test/tap_spec.rb | 2 +- Library/Homebrew/unlink.rb | 2 +- Library/Homebrew/utils/ruby.sh | 2 +- completions/zsh/_brew | 10 ++--- docs/Manpage.md | 30 ++++++------- manpages/brew.1 | 38 ++++++++--------- 52 files changed, 160 insertions(+), 159 deletions(-) diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index 6e0c581902..03814cc855 100644 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -152,7 +152,7 @@ class Build system "git", "add", "-A" end if args.interactive? - ohai "Entering interactive mode" + ohai "Entering interactive mode..." puts <<~EOS Type `exit` to return and finalize the installation. Install to this prefix: #{formula.prefix} diff --git a/Library/Homebrew/cask/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/artifact/abstract_uninstall.rb index 7705f9f65d..3daf5e2abf 100644 --- a/Library/Homebrew/cask/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/artifact/abstract_uninstall.rb @@ -303,7 +303,7 @@ module Cask message = "uninstall script #{executable} does not exist" raise CaskError, "#{message}." unless force - opoo "#{message}, skipping." + opoo "#{message}; skipping." return end @@ -398,7 +398,7 @@ module Cask false end - opoo "The following files could not trashed, please do so manually:" + opoo "The following files could not be trashed, please do so manually:" $stderr.puts untrashable [trashed, untrashable] diff --git a/Library/Homebrew/cask/artifact/moved.rb b/Library/Homebrew/cask/artifact/moved.rb index bd9287ad29..6ad4cf61cc 100644 --- a/Library/Homebrew/cask/artifact/moved.rb +++ b/Library/Homebrew/cask/artifact/moved.rb @@ -48,7 +48,7 @@ module Cask raise CaskError, "It seems the #{self.class.english_name} source '#{source}' is not there." end - ohai "Moving #{self.class.english_name} '#{source.basename}' to '#{target}'." + ohai "Moving #{self.class.english_name} '#{source.basename}' to '#{target}'" if target.dirname.ascend.find(&:directory?).writable? target.dirname.mkpath else @@ -84,7 +84,7 @@ module Cask raise CaskError, "It seems the #{self.class.english_name} source '#{target}' is not there." end - ohai "Backing #{self.class.english_name} '#{target.basename}' up to '#{source}'." + ohai "Backing #{self.class.english_name} '#{target.basename}' up to '#{source}'" source.dirname.mkpath # We need to preserve extended attributes between copies. @@ -94,7 +94,7 @@ module Cask end def delete(target, force: false, command: nil, **_) - ohai "Removing #{self.class.english_name} '#{target}'." + ohai "Removing #{self.class.english_name} '#{target}'" raise CaskError, "Cannot remove undeletable #{self.class.english_name}." if MacOS.undeletable?(target) return unless Utils.path_occupied?(target) diff --git a/Library/Homebrew/cask/artifact/relocated.rb b/Library/Homebrew/cask/artifact/relocated.rb index 316da5d69a..17f2eceff4 100644 --- a/Library/Homebrew/cask/artifact/relocated.rb +++ b/Library/Homebrew/cask/artifact/relocated.rb @@ -82,7 +82,7 @@ module Cask altnames = command.run("/usr/bin/xattr", args: ["-p", ALT_NAME_ATTRIBUTE, file], print_stderr: false).stdout.sub(/\A\((.*)\)\Z/, '\1') - odebug "Existing metadata is: '#{altnames}'" + odebug "Existing metadata is: #{altnames}" altnames.concat(", ") unless altnames.empty? altnames.concat(%Q("#{altname}")) altnames = "(#{altnames})" diff --git a/Library/Homebrew/cask/artifact/symlinked.rb b/Library/Homebrew/cask/artifact/symlinked.rb index bb423e69d4..653caeed91 100644 --- a/Library/Homebrew/cask/artifact/symlinked.rb +++ b/Library/Homebrew/cask/artifact/symlinked.rb @@ -65,14 +65,14 @@ module Cask end end - ohai "Linking #{self.class.english_name} '#{source.basename}' to '#{target}'." + ohai "Linking #{self.class.english_name} '#{source.basename}' to '#{target}'" create_filesystem_link(**options) end def unlink(**) return unless target.symlink? - ohai "Unlinking #{self.class.english_name} '#{target}'." + ohai "Unlinking #{self.class.english_name} '#{target}'" target.delete end diff --git a/Library/Homebrew/cask/cask_loader.rb b/Library/Homebrew/cask/cask_loader.rb index b49ad9275e..d6dab183ca 100644 --- a/Library/Homebrew/cask/cask_loader.rb +++ b/Library/Homebrew/cask/cask_loader.rb @@ -115,7 +115,7 @@ module Cask path.dirname.mkpath begin - ohai "Downloading #{url}." + ohai "Downloading #{url}" curl_download url, to: path rescue ErrorDuringExecution raise CaskUnavailableError.new(token, "Failed to download #{Formatter.url(url)}.") diff --git a/Library/Homebrew/cask/cmd/abstract_command.rb b/Library/Homebrew/cask/cmd/abstract_command.rb index afa69cc2fa..334fb69ebf 100644 --- a/Library/Homebrew/cask/cmd/abstract_command.rb +++ b/Library/Homebrew/cask/cmd/abstract_command.rb @@ -129,7 +129,7 @@ module Cask matches = search_casks(cask_token) if matches.one? - "Did you mean “#{matches.first}”?" + "Did you mean '#{matches.first}'?" elsif !matches.empty? "Did you mean one of these?\n#{Formatter.columns(matches.take(20))}" end diff --git a/Library/Homebrew/cask/cmd/internal_stanza.rb b/Library/Homebrew/cask/cmd/internal_stanza.rb index e134dd87d0..2ea3385426 100644 --- a/Library/Homebrew/cask/cmd/internal_stanza.rb +++ b/Library/Homebrew/cask/cmd/internal_stanza.rb @@ -80,7 +80,7 @@ module Cask return if DSL::DSL_METHODS.include?(stanza) raise UsageError, <<~EOS - Unknown/unsupported stanza: '#{stanza}' + Unknown/unsupported stanza '#{stanza}'. Check cask reference for supported stanzas. EOS end diff --git a/Library/Homebrew/cask/download.rb b/Library/Homebrew/cask/download.rb index 30efff34fe..a5b3d31f74 100644 --- a/Library/Homebrew/cask/download.rb +++ b/Library/Homebrew/cask/download.rb @@ -63,7 +63,7 @@ module Cask end begin - ohai "Verifying checksum for cask '#{@cask}'." if verbose? + ohai "Verifying checksum for cask '#{@cask}'" if verbose? fn.verify_checksum(@cask.sha256) rescue ChecksumMissingError opoo <<~EOS diff --git a/Library/Homebrew/cask/dsl.rb b/Library/Homebrew/cask/dsl.rb index 7c361dd14c..3125316274 100644 --- a/Library/Homebrew/cask/dsl.rb +++ b/Library/Homebrew/cask/dsl.rb @@ -201,7 +201,7 @@ module Cask def version(arg = nil) set_unique_stanza(:version, arg.nil?) do if !arg.is_a?(String) && arg != :latest - raise CaskInvalidError.new(cask, "invalid 'version' value: '#{arg.inspect}'") + raise CaskInvalidError.new(cask, "invalid 'version' value: #{arg.inspect}") end DSL::Version.new(arg) @@ -216,7 +216,7 @@ module Cask when String Checksum.new(arg) else - raise CaskInvalidError.new(cask, "invalid 'sha256' value: '#{arg.inspect}'") + raise CaskInvalidError.new(cask, "invalid 'sha256' value: #{arg.inspect}") end end end diff --git a/Library/Homebrew/cask/dsl/caveats.rb b/Library/Homebrew/cask/dsl/caveats.rb index 55c77cb117..e3a46f44bd 100644 --- a/Library/Homebrew/cask/dsl/caveats.rb +++ b/Library/Homebrew/cask/dsl/caveats.rb @@ -92,7 +92,7 @@ module Cask caveat :zsh_path_helper do |path| <<~EOS To use #{@cask}, zsh users may need to add the following line to their - ~/.zprofile. (Among other effects, #{path} will be added to the + ~/.zprofile. (Among other effects, #{path} will be added to the PATH environment variable): eval `/usr/libexec/path_helper -s` EOS diff --git a/Library/Homebrew/cask/dsl/container.rb b/Library/Homebrew/cask/dsl/container.rb index 22c146f319..852907b32e 100644 --- a/Library/Homebrew/cask/dsl/container.rb +++ b/Library/Homebrew/cask/dsl/container.rb @@ -19,7 +19,7 @@ module Cask def initialize(pairs = {}) @pairs = pairs pairs.each do |key, value| - raise "invalid container key: '#{key.inspect}'" unless VALID_KEYS.include?(key) + raise "invalid container key: #{key.inspect}" unless VALID_KEYS.include?(key) send(:"#{key}=", value) end diff --git a/Library/Homebrew/cask/dsl/depends_on.rb b/Library/Homebrew/cask/dsl/depends_on.rb index d4799d3899..5bb3deda8b 100644 --- a/Library/Homebrew/cask/dsl/depends_on.rb +++ b/Library/Homebrew/cask/dsl/depends_on.rb @@ -52,7 +52,7 @@ module Cask end def macos=(*args) - raise "Only a single 'depends_on macos:' is allowed." if defined?(@macos) + raise "Only a single 'depends_on macos' is allowed." if defined?(@macos) begin @macos = if args.count > 1 diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index c8f0ad3bc3..0f1467862d 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -280,7 +280,7 @@ module Cask raise CaskError, "Cask #{@cask} depends on hardware architecture being one of " \ "[#{@cask.depends_on.arch.map(&:to_s).join(", ")}], " \ - "but you are running #{@current_arch}" + "but you are running #{@current_arch}." end def x11_dependencies diff --git a/Library/Homebrew/cask/metadata.rb b/Library/Homebrew/cask/metadata.rb index 59145c579d..20e5b8953f 100644 --- a/Library/Homebrew/cask/metadata.rb +++ b/Library/Homebrew/cask/metadata.rb @@ -32,7 +32,7 @@ module Cask end if create && !path.directory? - odebug "Creating metadata directory #{path}." + odebug "Creating metadata directory: #{path}" path.mkpath end @@ -50,7 +50,7 @@ module Cask subdir = parent.join(leaf) if create && !subdir.directory? - odebug "Creating metadata subdirectory #{subdir}." + odebug "Creating metadata subdirectory: #{subdir}" subdir.mkpath end diff --git a/Library/Homebrew/cask/staged.rb b/Library/Homebrew/cask/staged.rb index 6069aef6b7..bc05bb0b79 100644 --- a/Library/Homebrew/cask/staged.rb +++ b/Library/Homebrew/cask/staged.rb @@ -29,7 +29,7 @@ module Cask full_paths = remove_nonexistent(paths) return if full_paths.empty? - ohai "Changing ownership of paths required by #{@cask}; your password may be necessary" + ohai "Changing ownership of paths required by #{@cask}; your password may be necessary." @command.run!("/usr/sbin/chown", args: ["-R", "--", "#{user}:#{group}", *full_paths], sudo: true) end diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb index cd792cd349..75f0044047 100644 --- a/Library/Homebrew/caveats.rb +++ b/Library/Homebrew/caveats.rb @@ -62,7 +62,7 @@ class Caveats if f.bin.directory? || f.sbin.directory? s << <<~EOS - If you need to have #{f.name} first in your PATH run: + If you need to have #{f.name} first in your PATH, run: EOS s << " #{Utils::Shell.prepend_path_in_profile(f.opt_bin.to_s)}\n" if f.bin.directory? s << " #{Utils::Shell.prepend_path_in_profile(f.opt_sbin.to_s)}\n" if f.sbin.directory? diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index 2005550829..b6ce4a8ca6 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -96,7 +96,7 @@ module Homebrew fetched_bottle = false onoe e.message - opoo "Bottle fetch failed: fetching the source." + opoo "Bottle fetch failed, fetching the source instead." else fetched_bottle = true end diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 15d9bb4b80..a2bde175f0 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -184,7 +184,7 @@ module Homebrew # head-only without --HEAD is an error if !args.HEAD? && f.stable.nil? odie <<~EOS - #{f.full_name} is a head-only formula + #{f.full_name} is a head-only formula. To install it, run: brew install --HEAD #{f.full_name} EOS @@ -208,7 +208,7 @@ module Homebrew if f.outdated? optlinked_version = Keg.for(f.opt_prefix).version onoe <<~EOS - #{f.full_name} #{optlinked_version} is already installed + #{f.full_name} #{optlinked_version} is already installed. To upgrade to #{f.version}, run: brew upgrade #{f.full_name} EOS @@ -216,7 +216,7 @@ module Homebrew installed_formulae << f elsif !args.quiet? opoo <<~EOS - #{f.full_name} #{f.pkg_version} is already installed and up-to-date + #{f.full_name} #{f.pkg_version} is already installed and up-to-date. To reinstall #{f.pkg_version}, run: brew reinstall #{f.name} EOS @@ -239,13 +239,13 @@ module Homebrew nil else <<~EOS - #{msg} - The currently linked version is #{f.linked_version} + #{msg}. + The currently linked version is: #{f.linked_version} EOS end elsif !f.linked? || f.keg_only? msg = <<~EOS - #{msg}, it's just not linked + #{msg}, it's just not linked. To link this version, run: brew link #{f} EOS @@ -257,7 +257,7 @@ module Homebrew nil else <<~EOS - #{msg} and up-to-date + #{msg} and up-to-date. To reinstall #{f.pkg_version}, run: brew reinstall #{f.name} EOS @@ -266,21 +266,23 @@ module Homebrew opoo msg if msg elsif !f.any_version_installed? && old_formula = f.old_installed_formulae.first msg = "#{old_formula.full_name} #{old_formula.any_installed_version} already installed" - if !old_formula.linked? && !old_formula.keg_only? - msg = <<~EOS + msg = if !old_formula.linked? && !old_formula.keg_only? + <<~EOS #{msg}, it's just not linked. To link this version, run: brew link #{old_formula.full_name} EOS elsif args.quiet? - msg = nil + nil + else + "#{msg}." end opoo msg if msg elsif f.migration_needed? && !args.force? # Check if the formula we try to install is the same as installed # but not migrated one. If --force is passed then install anyway. opoo <<~EOS - #{f.oldname} is already installed, it's just not migrated + #{f.oldname} is already installed, it's just not migrated. To migrate this formula, run: brew migrate #{f} Or to force-install it, run: diff --git a/Library/Homebrew/cmd/link.rb b/Library/Homebrew/cmd/link.rb index 6db1324d2e..2952c86e36 100644 --- a/Library/Homebrew/cmd/link.rb +++ b/Library/Homebrew/cmd/link.rb @@ -104,7 +104,7 @@ module Homebrew puts raise else - puts "#{n} symlinks created" + puts "#{n} symlinks created." end puts_keg_only_path_message(keg) if keg_only && !Homebrew::EnvConfig.developer? diff --git a/Library/Homebrew/cmd/log.rb b/Library/Homebrew/cmd/log.rb index 06ca7888b5..42344b700b 100644 --- a/Library/Homebrew/cmd/log.rb +++ b/Library/Homebrew/cmd/log.rb @@ -65,7 +65,7 @@ module Homebrew if File.exist? "#{repo}/.git/shallow" opoo <<~EOS #{name} is a shallow clone so only partial output will be shown. - To get a full clone run: + To get a full clone, run: git -C "#{git_cd}" fetch --unshallow EOS end diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index b3a0d48e83..61bcb03e1e 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -54,7 +54,7 @@ module Homebrew puts <<~EOS #{Tty.bold}Read the analytics documentation (and how to opt-out) here: #{Formatter.url("https://docs.brew.sh/Analytics")}#{Tty.reset} - No analytics have been recorded yet (or will be during this `brew` run). + No analytics have been recorded yet (nor will be during this `brew` run). EOS @@ -343,7 +343,7 @@ class Reporter new_tap = Tap.fetch(new_tap_name) new_tap.install unless new_tap.installed? ohai "#{name} has been moved to Homebrew.", <<~EOS - To uninstall the cask run: + To uninstall the cask, run: brew uninstall --cask --force #{name} EOS next if (HOMEBREW_CELLAR/new_name.split("/").last).directory? @@ -384,7 +384,7 @@ class Reporter EOS else ohai "#{name} has been moved to Homebrew Cask.", <<~EOS - To uninstall the formula and install the cask run: + To uninstall the formula and install the cask, run: brew uninstall --force #{name} brew tap #{new_tap_name} brew install --cask #{new_name} diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 8b1ea9f54b..c5b8080c51 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -114,8 +114,8 @@ pop_stash() { pop_stash_message() { [[ -z "$STASHED" ]] && return - echo "To restore the stashed changes to $DIR run:" - echo " 'cd $DIR && git stash pop'" + echo "To restore the stashed changes to $DIR, run:" + echo " cd $DIR && git stash pop" unset STASHED } diff --git a/Library/Homebrew/cmd/vendor-install.sh b/Library/Homebrew/cmd/vendor-install.sh index 36257eda40..0006083576 100644 --- a/Library/Homebrew/cmd/vendor-install.sh +++ b/Library/Homebrew/cmd/vendor-install.sh @@ -133,7 +133,7 @@ fetch() { odie < e # rubocop:disable Lint/RescueException opoo "The cleaning step did not complete successfully" - puts "Still, the installation was successful, so we will link it into your prefix" + puts "Still, the installation was successful, so we will link it into your prefix." odebug e, e.backtrace Homebrew.failed = true @show_summary_heading = true diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index 45dfb71a2c..8b7089bb57 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -603,7 +603,7 @@ class Keg begin keg = Keg.for(src) rescue NotAKegError - puts "Won't resolve conflicts for symlink #{dst} as it doesn't resolve into the Cellar" if verbose + puts "Won't resolve conflicts for symlink #{dst} as it doesn't resolve into the Cellar." if verbose return end diff --git a/Library/Homebrew/manpages/brew.1.md.erb b/Library/Homebrew/manpages/brew.1.md.erb index 057b4ddf1a..194740e3fc 100644 --- a/Library/Homebrew/manpages/brew.1.md.erb +++ b/Library/Homebrew/manpages/brew.1.md.erb @@ -104,7 +104,7 @@ can take several different forms: * An arbitrary file: Homebrew can install formulae from a local path. It can point to either a formula file or a bottle. - Prefix relative paths with `./` to prevent them being interpreted as a + Prefix relative paths with `./` to prevent them from being interpreted as a formula or tap name. ## SPECIFYING CASKS diff --git a/Library/Homebrew/missing_formula.rb b/Library/Homebrew/missing_formula.rb index 552f6b4f08..1edc0f3375 100644 --- a/Library/Homebrew/missing_formula.rb +++ b/Library/Homebrew/missing_formula.rb @@ -141,7 +141,7 @@ module Homebrew ohai "Searching for a previously deleted formula (in the last month)..." if (tap.path/".git/shallow").exist? opoo <<~EOS - #{tap} is shallow clone. To get complete history run: + #{tap} is shallow clone. To get its complete history, run: git -C "$(brew --repo #{tap})" fetch --unshallow EOS @@ -168,10 +168,10 @@ module Homebrew #{name} was deleted from #{tap.name} in commit #{short_hash}: #{commit_message} - To show the formula before removal run: + To show the formula before removal, run: git -C "$(brew --repo #{tap})" show #{short_hash}^:#{relative_path} - If you still use this formula consider creating your own tap: + If you still use this formula, consider creating your own tap: #{Formatter.url("https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap")} EOS end diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index 41688a0f07..4a3e729fe8 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -266,7 +266,7 @@ module OS Update them from Software Update in #{software_update_location} or run: softwareupdate --all --install --force - If that doesn't show you an update run: + If that doesn't show you any updates, run: sudo rm -rf /Library/Developer/CommandLineTools sudo xcode-select --install diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index 39a65fdd9c..47920e13c8 100644 --- a/Library/Homebrew/resource.rb +++ b/Library/Homebrew/resource.rb @@ -150,7 +150,7 @@ class Resource def verify_download_integrity(fn) if fn.file? - ohai "Verifying checksum for '#{fn.basename}'." if verbose? + ohai "Verifying checksum for '#{fn.basename}'" if verbose? fn.verify_checksum(checksum) end rescue ChecksumMissingError diff --git a/Library/Homebrew/shims/linux/super/make b/Library/Homebrew/shims/linux/super/make index d47a25ec30..36412314a1 100755 --- a/Library/Homebrew/shims/linux/super/make +++ b/Library/Homebrew/shims/linux/super/make @@ -1,6 +1,6 @@ #!/bin/bash -pathremove () { +pathremove() { local IFS=':' NEWPATH="" DIR="" PATHVARIABLE=${2:-PATH} for DIR in ${!PATHVARIABLE} ; do if [ "$DIR" != "$1" ] ; then diff --git a/Library/Homebrew/system_command.rb b/Library/Homebrew/system_command.rb index 971c2e8b51..7d049c0c62 100644 --- a/Library/Homebrew/system_command.rb +++ b/Library/Homebrew/system_command.rb @@ -89,7 +89,7 @@ class SystemCommand env.each_key do |name| next if /^[\w&&\D]\w*$/.match?(name) - raise ArgumentError, "Invalid variable name: '#{name}'" + raise ArgumentError, "Invalid variable name: #{name}" end @env = env @input = Array(input) diff --git a/Library/Homebrew/test/cask/artifact/app_spec.rb b/Library/Homebrew/test/cask/artifact/app_spec.rb index 4cb1ad17fc..23a5cd944f 100644 --- a/Library/Homebrew/test/cask/artifact/app_spec.rb +++ b/Library/Homebrew/test/cask/artifact/app_spec.rb @@ -89,8 +89,8 @@ describe Cask::Artifact::App, :cask do describe "target is both writable and user-owned" do it "overwrites the existing app" do stdout = <<~EOS - ==> Removing App '#{target_path}'. - ==> Moving App 'Caffeine.app' to '#{target_path}'. + ==> Removing App '#{target_path}' + ==> Moving App 'Caffeine.app' to '#{target_path}' EOS stderr = <<~EOS @@ -137,8 +137,8 @@ describe Cask::Artifact::App, :cask do ).and_call_original stdout = <<~EOS - ==> Removing App '#{target_path}'. - ==> Moving App 'Caffeine.app' to '#{target_path}'. + ==> Removing App '#{target_path}' + ==> Moving App 'Caffeine.app' to '#{target_path}' EOS stderr = <<~EOS @@ -180,8 +180,8 @@ describe Cask::Artifact::App, :cask do it "overwrites the existing app" do stdout = <<~EOS - ==> Removing App '#{target_path}'. - ==> Moving App 'Caffeine.app' to '#{target_path}'. + ==> Removing App '#{target_path}' + ==> Moving App 'Caffeine.app' to '#{target_path}' EOS stderr = <<~EOS diff --git a/Library/Homebrew/test/cask/cmd/install_spec.rb b/Library/Homebrew/test/cask/cmd/install_spec.rb index adb7b6da2b..4b2d9d984c 100644 --- a/Library/Homebrew/test/cask/cmd/install_spec.rb +++ b/Library/Homebrew/test/cask/cmd/install_spec.rb @@ -12,7 +12,7 @@ describe Cask::Cmd::Install, :cask do output = Regexp.new <<~EOS ==> Downloading file:.*caffeine.zip ==> Installing Cask local-caffeine - ==> Moving App 'Caffeine.app' to '.*Caffeine.app'. + ==> Moving App 'Caffeine.app' to '.*Caffeine.app' .*local-caffeine was successfully installed! EOS @@ -118,7 +118,7 @@ describe Cask::Cmd::Install, :cask do }.to raise_error( Cask::CaskUnavailableError, "Cask 'localcaffeine' is unavailable: No Cask with this name exists. "\ - "Did you mean “local-caffeine”?", + "Did you mean 'local-caffeine'?", ) end diff --git a/Library/Homebrew/test/cask/cmd/reinstall_spec.rb b/Library/Homebrew/test/cask/cmd/reinstall_spec.rb index 4cf73637a1..9dae6d6720 100644 --- a/Library/Homebrew/test/cask/cmd/reinstall_spec.rb +++ b/Library/Homebrew/test/cask/cmd/reinstall_spec.rb @@ -15,11 +15,11 @@ describe Cask::Cmd::Reinstall, :cask do ==> Downloading file:.*caffeine.zip Already downloaded: .*--caffeine.zip ==> Uninstalling Cask local-caffeine - ==> Backing App 'Caffeine.app' up to '.*Caffeine.app'. - ==> Removing App '.*Caffeine.app'. + ==> Backing App 'Caffeine.app' up to '.*Caffeine.app' + ==> Removing App '.*Caffeine.app' ==> Purging files for version 1.2.3 of Cask local-caffeine ==> Installing Cask local-caffeine - ==> Moving App 'Caffeine.app' to '.*Caffeine.app'. + ==> Moving App 'Caffeine.app' to '.*Caffeine.app' .*local-caffeine was successfully installed! EOS diff --git a/Library/Homebrew/test/cask/cmd/uninstall_spec.rb b/Library/Homebrew/test/cask/cmd/uninstall_spec.rb index 8158d1c114..703b9c7443 100644 --- a/Library/Homebrew/test/cask/cmd/uninstall_spec.rb +++ b/Library/Homebrew/test/cask/cmd/uninstall_spec.rb @@ -15,8 +15,8 @@ describe Cask::Cmd::Uninstall, :cask do output = Regexp.new <<~EOS ==> Uninstalling Cask local-caffeine - ==> Backing App 'Caffeine.app' up to '.*Caffeine.app'. - ==> Removing App '.*Caffeine.app'. + ==> Backing App 'Caffeine.app' up to '.*Caffeine.app' + ==> Removing App '.*Caffeine.app' ==> Purging files for version 1.2.3 of Cask local-caffeine EOS diff --git a/Library/Homebrew/test/diagnostic_checks_spec.rb b/Library/Homebrew/test/diagnostic_checks_spec.rb index 72a23e16d9..e62e6af20a 100644 --- a/Library/Homebrew/test/diagnostic_checks_spec.rb +++ b/Library/Homebrew/test/diagnostic_checks_spec.rb @@ -70,7 +70,7 @@ describe Homebrew::Diagnostic::Checks do expect(subject.check_user_path_1).to be nil expect(subject.check_user_path_2) - .to match("Homebrew's bin was not found in your PATH.") + .to match("Homebrew's \"bin\" was not found in your PATH.") end specify "#check_user_path_3" do @@ -83,7 +83,7 @@ describe Homebrew::Diagnostic::Checks do expect(subject.check_user_path_1).to be nil expect(subject.check_user_path_2).to be nil expect(subject.check_user_path_3) - .to match("Homebrew's sbin was not found in your PATH") + .to match("Homebrew's \"sbin\" was not found in your PATH") ensure sbin.rmtree end diff --git a/Library/Homebrew/test/tap_spec.rb b/Library/Homebrew/test/tap_spec.rb index 691e5fa61c..9a108ec90d 100644 --- a/Library/Homebrew/test/tap_spec.rb +++ b/Library/Homebrew/test/tap_spec.rb @@ -194,7 +194,7 @@ describe Tap do expect(services_tap).not_to be_private end - it "returns nil if the Tap is not a Git repo" do + it "returns nil if the Tap is not a Git repository" do expect(subject.remote).to be nil end diff --git a/Library/Homebrew/unlink.rb b/Library/Homebrew/unlink.rb index 47384433e3..ef9ce40722 100644 --- a/Library/Homebrew/unlink.rb +++ b/Library/Homebrew/unlink.rb @@ -24,7 +24,7 @@ module Homebrew keg.lock do print "Unlinking #{keg}... " puts if verbose - puts "#{keg.unlink(**options)} symlinks removed" + puts "#{keg.unlink(**options)} symlinks removed." end end end diff --git a/Library/Homebrew/utils/ruby.sh b/Library/Homebrew/utils/ruby.sh index d8ee1f1fc3..7d09e4d83a 100644 --- a/Library/Homebrew/utils/ruby.sh +++ b/Library/Homebrew/utils/ruby.sh @@ -1,6 +1,6 @@ export HOMEBREW_REQUIRED_RUBY_VERSION=2.6.3 -test_ruby () { +test_ruby() { if [[ ! -x $1 ]] then return 1 diff --git a/completions/zsh/_brew b/completions/zsh/_brew index f2b5befc3d..ea24e0e408 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -191,7 +191,7 @@ __brew_internal_commands() { 'test:Run the test method provided by an installed formula' 'tests:Run Homebrew'\''s unit and integration tests' 'typecheck:Check for typechecking errors using Sorbet' - 'unbottled:Outputs the unbottled dependents of formulae' + 'unbottled:Show the unbottled dependents of formulae' 'uninstall:Uninstall a formula or cask' 'unlink:Remove symlinks for formula from Homebrew'\''s prefix' 'unpack:Unpack the source files for formula into subdirectories of the current working directory' @@ -1197,7 +1197,7 @@ _brew_outdated() { '--formula[List only outdated formulae]' \ '--greedy[Print outdated casks with `auto_updates` or `version :latest`]' \ '--help[Show this message]' \ - '--json[Print output in JSON format. There are two versions: v1 and v2. v1 is deprecated and is currently the default if no version is specified. v2 prints outdated formulae and casks. ]' \ + '--json[Print output in JSON format. There are two versions: `v1` and `v2`. `v1` is deprecated and is currently the default if no version is specified. `v2` prints outdated formulae and casks. ]' \ '--quiet[List only the names of outdated kegs (takes precedence over `--verbose`)]' \ '--verbose[Include detailed version information]' \ '::formula:__brew_formulae' \ @@ -1599,11 +1599,11 @@ _brew_typecheck() { _brew_unbottled() { _arguments \ '--debug[Display any debugging information]' \ - '--dependents[Don'\''t get analytics data and sort by number of dependents instead]' \ + '--dependents[Skip getting analytics data and sort by number of dependents instead]' \ '--help[Show this message]' \ '--quiet[Make some output more quiet]' \ - '--tag[Use the specified bottle tag (e.g. big_sur) instead of the current OS]' \ - '--total[Output the number of unbottled and total formulae]' \ + '--tag[Use the specified bottle tag (e.g. `big_sur`) instead of the current OS]' \ + '--total[Print the number of unbottled and total formulae]' \ '--verbose[Make some output more verbose]' \ '::formula:__brew_formulae' } diff --git a/docs/Manpage.md b/docs/Manpage.md index 4b7e846a69..fa4072acb4 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -418,7 +418,7 @@ information is displayed in interactive shells, and suppressed otherwise. * `--cask`: List only outdated casks. * `--json`: - Print output in JSON format. There are two versions: v1 and v2. v1 is deprecated and is currently the default if no version is specified. v2 prints outdated formulae and casks. + Print output in JSON format. There are two versions: `v1` and `v2`. `v1` is deprecated and is currently the default if no version is specified. `v2` prints outdated formulae and casks. * `--fetch-HEAD`: Fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the repository's HEAD will only be checked for updates when a new stable or development version has been released. * `--greedy`: @@ -500,9 +500,9 @@ No online search is performed. * `--pull-request`: Search for GitHub pull requests containing *`text`*. * `--open`: - Search for only open GitHub pull requests + Search for only open GitHub pull requests. * `--closed`: - Search for only closed GitHub pull requests + Search for only closed GitHub pull requests. * `--macports`: Search for *`text`* in the given package manager's list. * `--fink`: @@ -765,6 +765,10 @@ non-zero status if any errors are found. Run additional, slower style checks that require a network connection. * `--new`: Run various additional style checks to determine if a new formula or cask is eligible for Homebrew. This should be used when creating new formula and implies `--strict` and `--online`. +* `--[no-]appcast`: + Audit the appcast. +* `--token-conflicts`: + Audit for token conflicts. * `--tap`: Check the formulae within the given tap, specified as *`user`*`/`*`repo`*. * `--fix`: @@ -789,10 +793,6 @@ non-zero status if any errors are found. Treat all named arguments as formulae. * `--cask`: Treat all named arguments as casks. -* `--[no-]appcast`: - Audit the appcast -* `--token-conflicts`: - Audit for token conflicts ### `bottle` [*`options`*] *`installed_formula`*|*`file`* [...] @@ -1093,7 +1093,7 @@ casks to check is taken from `HOMEBREW_LIVECHECK_WATCHLIST` or Generate Homebrew's manpages. -Not (yet) working on Apple Silicon. +*Note:* Not (yet) working on Apple Silicon. * `--fail-if-changed`: Return a failing status code if 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). @@ -1362,14 +1362,14 @@ Not (yet) working on Apple Silicon. ### `unbottled` [*`options`*] [*`formula`* ...] -Outputs the unbottled dependents of formulae. +Show the unbottled dependents of formulae. * `--tag`: - Use the specified bottle tag (e.g. big_sur) instead of the current OS. + Use the specified bottle tag (e.g. `big_sur`) instead of the current OS. * `--dependents`: - Don't get analytics data and sort by number of dependents instead. + Skip getting analytics data and sort by number of dependents instead. * `--total`: - Output the number of unbottled and total formulae. + Print the number of unbottled and total formulae. ### `unpack` [*`options`*] *`formula`* [...] @@ -1676,7 +1676,7 @@ can take several different forms: * An arbitrary file: Homebrew can install formulae from a local path. It can point to either a formula file or a bottle. - Prefix relative paths with `./` to prevent them being interpreted as a + Prefix relative paths with `./` to prevent them from being interpreted as a formula or tap name. ## SPECIFYING CASKS @@ -1697,7 +1697,7 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just *Default:* `native`. - `HOMEBREW_ARTIFACT_DOMAIN` -
Prefix all download URLs, including those for bottles, with this variable. For example, `HOMEBREW_ARTIFACT_DOMAIN=http://localhost:8080` will cause a formula with the URL `https://example.com/foo.tar.gz` to instead download from `http://localhost:8080/example.com/foo.tar.gz`. +
Prefix all download URLs, including those for bottles, with this value. For example, `HOMEBREW_ARTIFACT_DOMAIN=http://localhost:8080` will cause a formula with the URL `https://example.com/foo.tar.gz` to instead download from `http://localhost:8080/example.com/foo.tar.gz`. - `HOMEBREW_AUTO_UPDATE_SECS`
Automatically check for updates once per this seconds interval. @@ -1878,7 +1878,7 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just *Note:* While ensuring your downloads are fully secure, this is likely to cause from-source SourceForge, some GNU & GNOME-hosted formulae to fail to download. - `HOMEBREW_NO_INSTALL_CLEANUP` -
If set, `brew install`, `brew upgrade` and `brew reinstall` will never automatically cleanup installed/upgraded/reinstalled formulae or all formulae every HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS days. +
If set, `brew install`, `brew upgrade` and `brew reinstall` will never automatically cleanup installed/upgraded/reinstalled formulae or all formulae every `HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS` days. - `HOMEBREW_PRY`
If set, use Pry for the `brew irb` command. diff --git a/manpages/brew.1 b/manpages/brew.1 index c3d90f7d6a..b1c21484ab 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -565,7 +565,7 @@ List only outdated casks\. . .TP \fB\-\-json\fR -Print output in JSON format\. There are two versions: v1 and v2\. v1 is deprecated and is currently the default if no version is specified\. v2 prints outdated formulae and casks\. +Print output in JSON format\. There are two versions: \fBv1\fR and \fBv2\fR\. \fBv1\fR is deprecated and is currently the default if no version is specified\. \fBv2\fR prints outdated formulae and casks\. . .TP \fB\-\-fetch\-HEAD\fR @@ -678,11 +678,11 @@ Search for GitHub pull requests containing \fItext\fR\. . .TP \fB\-\-open\fR -Search for only open GitHub pull requests +Search for only open GitHub pull requests\. . .TP \fB\-\-closed\fR -Search for only closed GitHub pull requests +Search for only closed GitHub pull requests\. . .TP \fB\-\-macports\fR @@ -1030,6 +1030,14 @@ Run additional, slower style checks that require a network connection\. Run various additional style checks to determine if a new formula or cask is eligible for Homebrew\. This should be used when creating new formula and implies \fB\-\-strict\fR and \fB\-\-online\fR\. . .TP +\fB\-\-[no\-]appcast\fR +Audit the appcast\. +. +.TP +\fB\-\-token\-conflicts\fR +Audit for token conflicts\. +. +.TP \fB\-\-tap\fR Check the formulae within the given tap, specified as \fIuser\fR\fB/\fR\fIrepo\fR\. . @@ -1077,14 +1085,6 @@ Treat all named arguments as formulae\. \fB\-\-cask\fR Treat all named arguments as casks\. . -.TP -\fB\-\-[no\-]appcast\fR -Audit the appcast -. -.TP -\fB\-\-token\-conflicts\fR -Audit for token conflicts -. .SS "\fBbottle\fR [\fIoptions\fR] \fIinstalled_formula\fR|\fIfile\fR [\.\.\.]" Generate a bottle (binary package) from a formula that was installed with \fB\-\-build\-bottle\fR\. If the formula specifies a rebuild version, it will be incremented in the generated DSL\. Passing \fB\-\-keep\-old\fR will attempt to keep it at its original value, while \fB\-\-no\-rebuild\fR will remove it\. . @@ -1506,7 +1506,7 @@ Only check casks\. Generate Homebrew\'s manpages\. . .P -Not (yet) working on Apple Silicon\. +\fINote:\fR Not (yet) working on Apple Silicon\. . .TP \fB\-\-fail\-if\-changed\fR @@ -1878,19 +1878,19 @@ Typecheck a single file\. Ignores input files that contain the given string in their paths (relative to the input path passed to Sorbet)\. . .SS "\fBunbottled\fR [\fIoptions\fR] [\fIformula\fR \.\.\.]" -Outputs the unbottled dependents of formulae\. +Show the unbottled dependents of formulae\. . .TP \fB\-\-tag\fR -Use the specified bottle tag (e\.g\. big_sur) instead of the current OS\. +Use the specified bottle tag (e\.g\. \fBbig_sur\fR) instead of the current OS\. . .TP \fB\-\-dependents\fR -Don\'t get analytics data and sort by number of dependents instead\. +Skip getting analytics data and sort by number of dependents instead\. . .TP \fB\-\-total\fR -Output the number of unbottled and total formulae\. +Print the number of unbottled and total formulae\. . .SS "\fBunpack\fR [\fIoptions\fR] \fIformula\fR [\.\.\.]" Unpack the source files for \fIformula\fR into subdirectories of the current working directory\. @@ -2322,7 +2322,7 @@ Sometimes a formula from a tapped repository may conflict with one in \fBhomebre . .TP An arbitrary file -Homebrew can install formulae from a local path\. It can point to either a formula file or a bottle\. Prefix relative paths with \fB\./\fR to prevent them being interpreted as a formula or tap name\. +Homebrew can install formulae from a local path\. It can point to either a formula file or a bottle\. Prefix relative paths with \fB\./\fR to prevent them from being interpreted as a formula or tap name\. . .SH "SPECIFYING CASKS" Many Homebrew Cask commands accept one or more \fIcask\fR arguments\. These can be specified the same way as the \fIformula\fR arguments described in \fBSPECIFYING FORMULAE\fR above\. @@ -2343,7 +2343,7 @@ Linux only: Pass this value to a type name representing the compiler\'s \fB\-mar \fBHOMEBREW_ARTIFACT_DOMAIN\fR . .br -Prefix all download URLs, including those for bottles, with this variable\. For example, \fBHOMEBREW_ARTIFACT_DOMAIN=http://localhost:8080\fR will cause a formula with the URL \fBhttps://example\.com/foo\.tar\.gz\fR to instead download from \fBhttp://localhost:8080/example\.com/foo\.tar\.gz\fR\. +Prefix all download URLs, including those for bottles, with this value\. For example, \fBHOMEBREW_ARTIFACT_DOMAIN=http://localhost:8080\fR will cause a formula with the URL \fBhttps://example\.com/foo\.tar\.gz\fR to instead download from \fBhttp://localhost:8080/example\.com/foo\.tar\.gz\fR\. . .TP \fBHOMEBREW_AUTO_UPDATE_SECS\fR @@ -2682,7 +2682,7 @@ If set, forbid redirects from secure HTTPS to insecure HTTP\. \fBHOMEBREW_NO_INSTALL_CLEANUP\fR . .br -If set, \fBbrew install\fR, \fBbrew upgrade\fR and \fBbrew reinstall\fR will never automatically cleanup installed/upgraded/reinstalled formulae or all formulae every HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS days\. +If set, \fBbrew install\fR, \fBbrew upgrade\fR and \fBbrew reinstall\fR will never automatically cleanup installed/upgraded/reinstalled formulae or all formulae every \fBHOMEBREW_CLEANUP_PERIODIC_FULL_DAYS\fR days\. . .TP \fBHOMEBREW_PRY\fR