diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index ca162a051c..9c5502d1a2 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -201,7 +201,7 @@ then odie < 1 + raise UsageError, "Only one `--url` can be specified." if pr_url&.count&.> 1 labels = if pr_url && (first_pr_url = pr_url.first) pr = GitHub::API.open_rest(first_pr_url) diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb index 28e66d480e..d34b62196c 100644 --- a/Library/Homebrew/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/ENV/shared.rb @@ -267,7 +267,7 @@ module SharedEnvExtension ohai "Using a Fortran compiler found at #{gfortran}" end if gfortran - puts "This may be changed by setting the FC environment variable." + puts "This may be changed by setting the `$FC` environment variable." self["FC"] = self["F77"] = gfortran flags = FC_FLAG_VARS end diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index 145917e598..1d563b7694 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -417,7 +417,7 @@ module OS macOS won't move relative symlinks across volumes unless the target file already exists. Formulae known to be affected by this are Git and Narwhal. - You should set the "HOMEBREW_TEMP" environment variable to a suitable + You should set the `$HOMEBREW_TEMP` environment variable to a suitable directory on the same volume as your Cellar. #{support_tier_message(tier: 2)} diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 472b979791..757bf4fac5 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -382,7 +382,7 @@ class FormulaInstaller check_installation_already_attempted if force_bottle? && !pour_bottle? - raise CannotInstallFormulaError, "--force-bottle passed but #{formula.full_name} has no bottle!" + raise CannotInstallFormulaError, "`--force-bottle` passed but #{formula.full_name} has no bottle!" end if Homebrew.default_prefix? && diff --git a/Library/Homebrew/resource_auditor.rb b/Library/Homebrew/resource_auditor.rb index 0a6a9f83df..ea286b6f9a 100644 --- a/Library/Homebrew/resource_auditor.rb +++ b/Library/Homebrew/resource_auditor.rb @@ -49,12 +49,12 @@ module Homebrew 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))) - problem "version #{version} does not match #{GitHubPackages::VALID_OCI_TAG_REGEX.source}" + problem "`version #{version}` does not match #{GitHubPackages::VALID_OCI_TAG_REGEX.source}" elsif !version.detected_from_url? version_text = version version_url = Version.detect(url, **specs) if version_url.to_s == version_text.to_s && version.instance_of?(Version) - problem "version #{version_text} is redundant with version scanned from URL" + problem "`version #{version_text}` is redundant with version scanned from URL" end end end diff --git a/Library/Homebrew/services/cli.rb b/Library/Homebrew/services/cli.rb index 4cb4518eee..43309e12dc 100644 --- a/Library/Homebrew/services/cli.rb +++ b/Library/Homebrew/services/cli.rb @@ -43,7 +43,7 @@ module Homebrew # Check if formula has been found. def self.check!(targets) - raise UsageError, "Formula(e) missing, please provide a formula name or use --all" if targets.empty? + raise UsageError, "Formula(e) missing, please provide a formula name or use `--all`." if targets.empty? true end diff --git a/Library/Homebrew/test/bottle_specification_spec.rb b/Library/Homebrew/test/bottle_specification_spec.rb index 51eed26c67..5c1888f7c2 100644 --- a/Library/Homebrew/test/bottle_specification_spec.rb +++ b/Library/Homebrew/test/bottle_specification_spec.rb @@ -23,7 +23,7 @@ RSpec.describe BottleSpecification do it "works with cellar" do checksums = [ - { cellar: :any_skip_relocation, tag: :arm64_big_sur, digest: "deadbeef" * 8 }, + { cellar: :any_skip_relocation, tag: :arm64_big_sur, digest: "deadbeef" * 8 }, { cellar: :any, tag: :big_sur, digest: "faceb00c" * 8 }, { cellar: "/usr/local/Cellar", tag: :catalina, digest: "baadf00d" * 8 }, { cellar: Homebrew::DEFAULT_CELLAR, tag: :mojave, digest: "8badf00d" * 8 }, diff --git a/Library/Homebrew/test/services/cli_spec.rb b/Library/Homebrew/test/services/cli_spec.rb index 000039475d..92d549d512 100644 --- a/Library/Homebrew/test/services/cli_spec.rb +++ b/Library/Homebrew/test/services/cli_spec.rb @@ -46,14 +46,15 @@ RSpec.describe Homebrew::Services::Cli do it "checks the input does not exist" do expect do services_cli.check!([]) - end.to raise_error(UsageError, "Invalid usage: Formula(e) missing, please provide a formula name or use --all") + end.to raise_error(UsageError, + "Invalid usage: Formula(e) missing, please provide a formula name or use `--all`.") end it "checks the input exists" do expect do services_cli.check!("hello") end.not_to raise_error(UsageError, - "Invalid usage: Formula(e) missing, please provide a formula name or use --all") + "Invalid usage: Formula(e) missing, please provide a formula name or use `--all`.") end end @@ -178,7 +179,7 @@ RSpec.describe Homebrew::Services::Cli do services_cli.install_service_file(service, nil) end.to raise_error( UsageError, - "Invalid usage: Formula `name` has not implemented #plist, #service or installed a locatable service file", + "Invalid usage: Formula `name` has not implemented #plist, #service or provided a locatable service file.", ) end end diff --git a/Library/Homebrew/test/services/commands/info_spec.rb b/Library/Homebrew/test/services/commands/info_spec.rb index f8f3fc21fe..8b5c5cefee 100644 --- a/Library/Homebrew/test/services/commands/info_spec.rb +++ b/Library/Homebrew/test/services/commands/info_spec.rb @@ -17,7 +17,8 @@ RSpec.describe Homebrew::Services::Commands::Info do it "fails with empty list" do expect do described_class.run([], verbose: false, json: false) - end.to raise_error UsageError, "Invalid usage: Formula(e) missing, please provide a formula name or use --all" + end.to raise_error UsageError, + "Invalid usage: Formula(e) missing, please provide a formula name or use `--all`." end it "succeeds with items" do diff --git a/Library/Homebrew/test/services/commands/restart_spec.rb b/Library/Homebrew/test/services/commands/restart_spec.rb index c35a543dd5..a43738ea4c 100644 --- a/Library/Homebrew/test/services/commands/restart_spec.rb +++ b/Library/Homebrew/test/services/commands/restart_spec.rb @@ -13,7 +13,8 @@ RSpec.describe Homebrew::Services::Commands::Restart do it "fails with empty list" do expect do described_class.run([], nil, verbose: false) - end.to raise_error UsageError, "Invalid usage: Formula(e) missing, please provide a formula name or use --all" + end.to raise_error UsageError, + "Invalid usage: Formula(e) missing, please provide a formula name or use `--all`." end it "starts if services are not loaded" do diff --git a/Library/Homebrew/test/version_spec.rb b/Library/Homebrew/test/version_spec.rb index 092978f651..9784cffb3d 100644 --- a/Library/Homebrew/test/version_spec.rb +++ b/Library/Homebrew/test/version_spec.rb @@ -104,7 +104,7 @@ RSpec.describe Version do it "raises an error" do expect do null_version.to_str - end.to raise_error NoMethodError, "undefined method `to_str' for Version:NULL" + end.to raise_error NoMethodError, "undefined method `to_str` for Version:NULL" end end diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index 490607e5e0..49d83b5084 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -723,7 +723,7 @@ class Version # @api public sig { returns(String) } def to_str - raise NoMethodError, "undefined method `to_str' for #{self.class}:NULL" if null? + raise NoMethodError, "undefined method `to_str` for #{self.class}:NULL" if null? T.must(version).to_str end