From 827480f06be420dae426a6bb60e8f9c0a0b75d15 Mon Sep 17 00:00:00 2001 From: Eric Knibbe Date: Fri, 15 Aug 2025 22:33:23 -0400 Subject: [PATCH] messages/comments: wording fixes --- Library/Homebrew/api.rb | 2 +- Library/Homebrew/cmd/deps.rb | 4 ++-- Library/Homebrew/compilers.rb | 2 +- Library/Homebrew/completions/bash.erb | 2 +- Library/Homebrew/completions/fish.erb | 2 +- Library/Homebrew/completions/zsh.erb | 2 +- Library/Homebrew/dependency_collector.rb | 2 +- Library/Homebrew/download_strategy.rb | 2 +- Library/Homebrew/formula_auditor.rb | 2 +- Library/Homebrew/formula_installer.rb | 2 +- Library/Homebrew/formulary.rb | 2 +- Library/Homebrew/install.rb | 4 ++-- Library/Homebrew/language/python.rb | 2 +- Library/Homebrew/livecheck/livecheck.rb | 2 +- Library/Homebrew/patch.rb | 2 +- Library/Homebrew/resource_auditor.rb | 4 ++-- Library/Homebrew/sandbox.rb | 2 +- Library/Homebrew/service.rb | 2 +- Library/Homebrew/services/cli.rb | 12 ++++++------ Library/Homebrew/shims/shared/curl | 2 +- Library/Homebrew/shims/shared/git | 6 +++--- Library/Homebrew/test/formula_auditor_spec.rb | 2 +- Library/Homebrew/test/formula_validation_spec.rb | 2 +- Library/Homebrew/test/service_spec.rb | 2 +- Library/Homebrew/test/services/cli_spec.rb | 6 +++--- Library/Homebrew/utils/github/api.rb | 2 +- 26 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Library/Homebrew/api.rb b/Library/Homebrew/api.rb index 1221d42d78..6f2043728a 100644 --- a/Library/Homebrew/api.rb +++ b/Library/Homebrew/api.rb @@ -27,7 +27,7 @@ module Homebrew api_url = "#{HOMEBREW_API_DEFAULT_DOMAIN}/#{endpoint}" output = Utils::Curl.curl_output("--fail", api_url) end - raise ArgumentError, "No file found at #{Tty.underline}#{api_url}#{Tty.reset}" unless output.success? + raise ArgumentError, "No file found at: #{Tty.underline}#{api_url}#{Tty.reset}" unless output.success? cache[endpoint] = JSON.parse(output.stdout, freeze: true) rescue JSON::ParserError diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb index 62f471820b..1c1e6634b0 100644 --- a/Library/Homebrew/cmd/deps.rb +++ b/Library/Homebrew/cmd/deps.rb @@ -88,8 +88,8 @@ module Homebrew sig { override.void } def run - raise UsageError, "`brew deps --os=all` is not supported" if args.os == "all" - raise UsageError, "`brew deps --arch=all` is not supported" if args.arch == "all" + raise UsageError, "`brew deps --os=all` is not supported." if args.os == "all" + raise UsageError, "`brew deps --arch=all` is not supported." if args.arch == "all" os, arch = T.must(args.os_arch_combinations.first) eval_all = args.eval_all? diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index b4b70c99d2..a0d08ca9d6 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -40,7 +40,7 @@ class CompilerFailure # Non-Apple compilers are in the format fails_with compiler => version if spec.is_a?(Hash) compiler, major_version = spec.first - raise ArgumentError, "The hash `fails_with` syntax only supports GCC" if compiler != :gcc + raise ArgumentError, "The `fails_with` hash syntax only supports GCC" if compiler != :gcc type = compiler # so fails_with :gcc => '7' simply marks all 7 releases incompatible diff --git a/Library/Homebrew/completions/bash.erb b/Library/Homebrew/completions/bash.erb index 995658837a..709e53f7ba 100644 --- a/Library/Homebrew/completions/bash.erb +++ b/Library/Homebrew/completions/bash.erb @@ -3,7 +3,7 @@ # # - For changes to a command under `COMMANDS` or `DEVELOPER COMMANDS` sections): # - Find the source file in `Library/Homebrew/[dev-]cmd/.{rb,sh}`. -# - For `.rb` files, edit the `_args` method. +# - For `.rb` files, edit the `cmd_args` block. # - For `.sh` files, edit the top comment, being sure to use the line prefix # `#:` for the comments to be recognized as documentation. If in doubt, # compare with already documented commands. diff --git a/Library/Homebrew/completions/fish.erb b/Library/Homebrew/completions/fish.erb index 1ec614d909..b31ebf13eb 100644 --- a/Library/Homebrew/completions/fish.erb +++ b/Library/Homebrew/completions/fish.erb @@ -3,7 +3,7 @@ # # - For changes to a command under `COMMANDS` or `DEVELOPER COMMANDS` sections): # - Find the source file in `Library/Homebrew/[dev-]cmd/.{rb,sh}`. -# - For `.rb` files, edit the `_args` method. +# - For `.rb` files, edit the `cmd_args` block. # - For `.sh` files, edit the top comment, being sure to use the line prefix # `#:` for the comments to be recognized as documentation. If in doubt, # compare with already documented commands. diff --git a/Library/Homebrew/completions/zsh.erb b/Library/Homebrew/completions/zsh.erb index 025ab24ea6..dc27021446 100644 --- a/Library/Homebrew/completions/zsh.erb +++ b/Library/Homebrew/completions/zsh.erb @@ -3,7 +3,7 @@ # # - For changes to a command under `COMMANDS` or `DEVELOPER COMMANDS` sections): # - Find the source file in `Library/Homebrew/[dev-]cmd/.{rb,sh}`. -# - For `.rb` files, edit the `_args` method. +# - For `.rb` files, edit the `cmd_args` block. # - For `.sh` files, edit the top comment, being sure to use the line prefix # `#:` for the comments to be recognized as documentation. If in doubt, # compare with already documented commands. diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb index 6fb78130ec..68e68c3fa9 100644 --- a/Library/Homebrew/dependency_collector.rb +++ b/Library/Homebrew/dependency_collector.rb @@ -169,7 +169,7 @@ class DependencyCollector when :maximum_macos then MacOSRequirement.new(tags, comparator: "<=") when :xcode then XcodeRequirement.new(tags) else - raise ArgumentError, "Unsupported special dependency #{spec.inspect}" + raise ArgumentError, "Unsupported special dependency: #{spec.inspect}" end end diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 61a1b9ce38..37bef20cf0 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -1600,7 +1600,7 @@ class DownloadStrategyDetector detect_from_symbol(using) else raise TypeError, - "Unknown download strategy specification #{using.inspect}" + "Unknown download strategy specification: #{using.inspect}" end end diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index ac6e5d0fc7..3e39551128 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -791,7 +791,7 @@ module Homebrew formula_suffix = stable.version.patch.to_i throttled_rate = formula.livecheck.throttle if throttled_rate && formula_suffix.modulo(throttled_rate).nonzero? - problem "should only be updated every #{throttled_rate} releases on multiples of #{throttled_rate}" + problem "Should only be updated every #{throttled_rate} releases on multiples of #{throttled_rate}" end case (url = stable.url) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 757bf4fac5..6bf6be477f 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -477,7 +477,7 @@ class FormulaInstaller raise CannotInstallFormulaError, "You must `brew unpin #{pinned_unsatisfied_deps * " "}` as installing " \ - "#{formula.full_name} requires the latest version of pinned dependencies" + "#{formula.full_name} requires the latest version of pinned dependencies." end sig { params(_formula: Formula).returns(T.nilable(T::Boolean)) } diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index f82edd031a..8135629707 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -711,7 +711,7 @@ module Formulary if ALLOWED_URL_SCHEMES.exclude?(url_scheme) raise UnsupportedInstallationMethod, "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 formula file in a tap " \ + "Use `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/install.rb b/Library/Homebrew/install.rb index 3afc44cccb..eafed0ffcc 100644 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -83,10 +83,10 @@ module Homebrew skip_link: false, overwrite: false ) - # head-only without --HEAD is an error + # HEAD-only without --HEAD is an error if !head && formula.stable.nil? odie <<~EOS - #{formula.full_name} is a head-only formula. + #{formula.full_name} is a HEAD-only formula. To install it, run: brew install --HEAD #{formula.full_name} EOS diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index aa62727bcd..6bd996d498 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -286,7 +286,7 @@ module Language def slice_resources!(resources_hash, resource_names) resource_names.map do |resource_name| resources_hash.delete(resource_name) do - raise ArgumentError, "Resource \"#{resource_name}\" is not defined in formula or is already used" + raise ArgumentError, "Resource \"#{resource_name}\" is not defined in formula or is already used." end end end diff --git a/Library/Homebrew/livecheck/livecheck.rb b/Library/Homebrew/livecheck/livecheck.rb index 38042e74de..12f2b2b426 100644 --- a/Library/Homebrew/livecheck/livecheck.rb +++ b/Library/Homebrew/livecheck/livecheck.rb @@ -245,7 +245,7 @@ module Homebrew end # Use the `stable` version for comparison except for installed - # head-only formulae. A formula with `stable` and `head` that's + # HEAD-only formulae. A formula with `stable` and `head` that's # installed using `--head` will still use the `stable` version for # comparison. current = if formula diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb index b6ff44d107..27638207b0 100644 --- a/Library/Homebrew/patch.rb +++ b/Library/Homebrew/patch.rb @@ -24,7 +24,7 @@ module Patch when nil raise ArgumentError, "nil value for strip" else - raise ArgumentError, "Unexpected value #{strip.inspect} for strip" + raise ArgumentError, "Unexpected value for strip: #{strip.inspect}" end end end diff --git a/Library/Homebrew/resource_auditor.rb b/Library/Homebrew/resource_auditor.rb index ea286b6f9a..bb0d5e81fe 100644 --- a/Library/Homebrew/resource_auditor.rb +++ b/Library/Homebrew/resource_auditor.rb @@ -45,7 +45,7 @@ module Homebrew def audit_version if version.nil? - problem "missing version" + problem "Missing version" elsif owner.is_a?(Formula) && !version.to_s.match?(GitHubPackages::VALID_OCI_TAG_REGEX) && (owner.core_formula? || (owner.bottle_defined? && GitHubPackages::URL_REGEX.match?(owner.bottle_specification.root_url))) @@ -137,7 +137,7 @@ module Homebrew # TODO: try remove the OS/env conditional if Homebrew::SimulateSystem.simulating_or_running_on_macos? && spec_name == :stable && owner.name != "ca-certificates" && curl_dep && !urls.find { |u| u.start_with?("http://") } - problem "should always include at least one HTTP mirror" + problem "Should always include at least one HTTP mirror" end return unless @online diff --git a/Library/Homebrew/sandbox.rb b/Library/Homebrew/sandbox.rb index 1f8e29c0ae..53f915295d 100644 --- a/Library/Homebrew/sandbox.rb +++ b/Library/Homebrew/sandbox.rb @@ -258,7 +258,7 @@ class Sandbox invalid_char = ['"', "'", "(", ")", "\n", "\\"].find do |c| path.to_s.include?(c) end - raise ArgumentError, "Invalid character #{invalid_char} in path: #{path}" if invalid_char + raise ArgumentError, "Invalid character '#{invalid_char}' in path: #{path}" if invalid_char case type when :regex then "regex #\"#{path}\"" diff --git a/Library/Homebrew/service.rb b/Library/Homebrew/service.rb index 487f75c650..9d648e2c54 100644 --- a/Library/Homebrew/service.rb +++ b/Library/Homebrew/service.rb @@ -164,7 +164,7 @@ module Homebrew @keep_alive = { always: value } when Hash unless (value.keys - KEEP_ALIVE_KEYS).empty? - raise TypeError, "Service#keep_alive allows only #{KEEP_ALIVE_KEYS}" + raise TypeError, "Service#keep_alive only allows: #{KEEP_ALIVE_KEYS}" end @keep_alive = value diff --git a/Library/Homebrew/services/cli.rb b/Library/Homebrew/services/cli.rb index 43309e12dc..e3c7a7aae0 100644 --- a/Library/Homebrew/services/cli.rb +++ b/Library/Homebrew/services/cli.rb @@ -71,7 +71,7 @@ module Homebrew Dir["#{System.path}homebrew.*.{plist,service}"].each do |file| next if running.include?(File.basename(file).sub(/\.(plist|service)$/i, "")) - puts "Removing unused service file #{file}" + puts "Removing unused service file: #{file}" rm file cleaned << file end @@ -90,7 +90,7 @@ module Homebrew def self.run(targets, service_file = nil, verbose: false) if service_file.present? file = Pathname.new service_file - raise UsageError, "Provided service file does not exist" unless file.exist? + raise UsageError, "Provided service file does not exist." unless file.exist? end targets.each do |service| @@ -119,7 +119,7 @@ module Homebrew if service_file.present? file = Pathname.new service_file - raise UsageError, "Provided service file does not exist" unless file.exist? + raise UsageError, "Provided service file does not exist." unless file.exist? end targets.each do |service| @@ -373,11 +373,11 @@ module Homebrew end def self.install_service_file(service, file) - raise UsageError, "Formula `#{service.name}` is not installed" unless service.installed? + raise UsageError, "Formula `#{service.name}` is not installed." unless service.installed? unless service.service_file.exist? raise UsageError, - "Formula `#{service.name}` has not implemented #plist, #service or installed a locatable service file" + "Formula `#{service.name}` has not implemented #plist, #service or provided a locatable service file." end temp = Tempfile.new(service.service_name) @@ -386,7 +386,7 @@ module Homebrew if sudo_service_user && System.launchctl? # set the username in the new plist file - ohai "Setting username in #{service.service_name} to #{System.user}" + ohai "Setting username in #{service.service_name} to: #{System.user}" plist_data = Plist.parse_xml(contents, marshal: false) plist_data["UserName"] = sudo_service_user plist_data.to_plist diff --git a/Library/Homebrew/shims/shared/curl b/Library/Homebrew/shims/shared/curl index 790bca07ce..434664e516 100755 --- a/Library/Homebrew/shims/shared/curl +++ b/Library/Homebrew/shims/shared/curl @@ -35,5 +35,5 @@ fi try_exec_non_system "${HOMEBREW_CURL:-curl}" "$@" safe_exec "/usr/bin/curl" "$@" -echo "Could not execute curl. Try HOMEBREW_FORCE_BREWED_CURL=1" >&2 +echo "Could not execute curl. Try setting HOMEBREW_FORCE_BREWED_CURL=1" >&2 exit 1 diff --git a/Library/Homebrew/shims/shared/git b/Library/Homebrew/shims/shared/git index d7193d3041..9c1e61a57a 100755 --- a/Library/Homebrew/shims/shared/git +++ b/Library/Homebrew/shims/shared/git @@ -1,12 +1,12 @@ #!/bin/bash -p -# This script because we support $HOMEBREW_GIT, $HOMEBREW_SVN, etc., Xcode-only and -# no Xcode/CLT configurations. Order is careful to be what the user would want. +# This script exists because we support $HOMEBREW_GIT, $HOMEBREW_SVN etc., and Xcode-only +# or no Xcode/CLT configurations. Order is careful to be what the user would want. # HOMEBREW_LIBRARY is set by bin/brew # SHIM_FILE is set by shims/utils.sh # HOMEBREW_GIT is set by brew.sh -# HOMEBREW_SVN is from the user environment. +# HOMEBREW_SVN is from the user environment # HOMEBREW_PREFIX is set by extend/ENV/super.rb # shellcheck disable=SC2154 if [[ -z "${HOMEBREW_LIBRARY}" ]] diff --git a/Library/Homebrew/test/formula_auditor_spec.rb b/Library/Homebrew/test/formula_auditor_spec.rb index 81bf79b8ff..9c5253ac1a 100644 --- a/Library/Homebrew/test/formula_auditor_spec.rb +++ b/Library/Homebrew/test/formula_auditor_spec.rb @@ -834,7 +834,7 @@ RSpec.describe Homebrew::FormulaAuditor do RUBY fa.audit_specs - expect(fa.problems.first[:message]).to match "should only be updated every 10 releases on multiples of 10" + expect(fa.problems.first[:message]).to match "Should only be updated every 10 releases on multiples of 10" end it "allows non-versioned formulae to have a `HEAD` spec" do diff --git a/Library/Homebrew/test/formula_validation_spec.rb b/Library/Homebrew/test/formula_validation_spec.rb index e578d79dce..96a5a682b1 100644 --- a/Library/Homebrew/test/formula_validation_spec.rb +++ b/Library/Homebrew/test/formula_validation_spec.rb @@ -68,7 +68,7 @@ RSpec.describe Formula do end.to fail_with_invalid :version end - specify "head-only is valid" do + specify "HEAD-only is valid" do f = formula do head "foo" end diff --git a/Library/Homebrew/test/service_spec.rb b/Library/Homebrew/test/service_spec.rb index 7fc6d6661d..29dcaf8676 100644 --- a/Library/Homebrew/test/service_spec.rb +++ b/Library/Homebrew/test/service_spec.rb @@ -68,7 +68,7 @@ RSpec.describe Homebrew::Service do expect do f.service.manual_command - end.to raise_error TypeError, "Service#keep_alive allows only [:always, :successful_exit, :crashed, :path]" + end.to raise_error TypeError, "Service#keep_alive only allows: [:always, :successful_exit, :crashed, :path]" end end diff --git a/Library/Homebrew/test/services/cli_spec.rb b/Library/Homebrew/test/services/cli_spec.rb index 92d549d512..c8cbc717c2 100644 --- a/Library/Homebrew/test/services/cli_spec.rb +++ b/Library/Homebrew/test/services/cli_spec.rb @@ -89,7 +89,7 @@ RSpec.describe Homebrew::Services::Cli do expect(Homebrew::Services::System).not_to receive(:root?) expect do services_cli.start(["service_name"], "/non/existent/path") - end.to raise_error(UsageError, "Invalid usage: Provided service file does not exist") + end.to raise_error(UsageError, "Invalid usage: Provided service file does not exist.") end it "checks empty targets cause no error" do @@ -112,7 +112,7 @@ RSpec.describe Homebrew::Services::Cli do expect(Homebrew::Services::System).not_to receive(:root?) expect do services_cli.start(["service_name"], "/hfdkjshksdjhfkjsdhf/fdsjghsdkjhb") - end.to raise_error(UsageError, "Invalid usage: Provided service file does not exist") + end.to raise_error(UsageError, "Invalid usage: Provided service file does not exist.") end it "checks empty targets cause no error" do @@ -165,7 +165,7 @@ RSpec.describe Homebrew::Services::Cli do service = instance_double(Homebrew::Services::FormulaWrapper, name: "name", installed?: false) expect do services_cli.install_service_file(service, nil) - end.to raise_error(UsageError, "Invalid usage: Formula `name` is not installed") + end.to raise_error(UsageError, "Invalid usage: Formula `name` is not installed.") end it "checks service file exists" do diff --git a/Library/Homebrew/utils/github/api.rb b/Library/Homebrew/utils/github/api.rb index 40170cf12e..048183b7cd 100644 --- a/Library/Homebrew/utils/github/api.rb +++ b/Library/Homebrew/utils/github/api.rb @@ -123,7 +123,7 @@ module GitHub end end - # Error when the user has no GitHub API credentials set at all (macOS keychain, GitHub CLI or envvar). + # Error when the user has no GitHub API credentials set at all (macOS keychain, GitHub CLI or env var). class MissingAuthenticationError < Error sig { void } def initialize