Skip to content

Commit

Permalink
use single quotes around stanza and parameter names
Browse files Browse the repository at this point in the history
  • Loading branch information
EricFromCanada committed Jan 26, 2021
1 parent 2ed324e commit 99ad335
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Library/Homebrew/cask/audit.rb
Expand Up @@ -416,7 +416,7 @@ def check_unnecessary_verified
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

Expand All @@ -427,7 +427,7 @@ def check_missing_verified
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

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/cmd/upgrade.rb
Expand Up @@ -101,7 +101,7 @@ def self.upgrade_casks(
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"
Expand Down
13 changes: 7 additions & 6 deletions Library/Homebrew/exceptions.rb
Expand Up @@ -384,8 +384,8 @@ def initialize(formula)
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
Expand All @@ -394,10 +394,11 @@ def initialize(formula)
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
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/extend/on_os.rb
Expand Up @@ -7,15 +7,15 @@ module OnOS
# # Do something Mac-specific
# end</pre>
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.
# <pre>on_linux do
# # Do something Linux-specific
# end</pre>
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

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/extend/os/linux/on_os.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/extend/os/mac/on_os.rb
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions Library/Homebrew/formula_auditor.rb
Expand Up @@ -221,13 +221,13 @@ def audit_deps
# 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

Expand Down Expand Up @@ -258,10 +258,10 @@ def audit_deps
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)

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/formula_installer.rb
Expand Up @@ -806,7 +806,7 @@ def finish
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
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/software_spec.rb
Expand Up @@ -356,7 +356,7 @@ def prefix=(prefix)
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
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/cask/audit_spec.rb
Expand Up @@ -917,7 +917,7 @@ def tmp_cask(name, text)
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
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/utils/ast.rb
Expand Up @@ -117,7 +117,7 @@ def add_bottle_block(bottle_output)
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
Expand Down

0 comments on commit 99ad335

Please sign in to comment.