diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index 09d05059ae..37f4562d5c 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -416,7 +416,7 @@ module Cask add_error "cask token underscores should be replaced by hyphens" if cask.token.include? "_" add_error "cask token should not contain double hyphens" if cask.token.include? "--" - if cask.token.match?(/[^a-z0-9\-]/) + if cask.token.match?(/[^a-z0-9-]/) add_error "cask token should only contain lowercase alphanumeric characters and hyphens" end diff --git a/Library/Homebrew/cask/url.rb b/Library/Homebrew/cask/url.rb index a59e1f07b1..91a30a9fb7 100644 --- a/Library/Homebrew/cask/url.rb +++ b/Library/Homebrew/cask/url.rb @@ -185,31 +185,31 @@ class URL < Delegator &block ) super( - if block - LazyObject.new do - *args = BlockDSL.new(uri, dsl: dsl, &block).call - options = args.last.is_a?(Hash) ? args.pop : {} - uri = T.let(args.first, T.any(URI::Generic, String)) - DSL.new(uri, **options) + if block + LazyObject.new do + *args = BlockDSL.new(uri, dsl: dsl, &block).call + options = args.last.is_a?(Hash) ? args.pop : {} + uri = T.let(args.first, T.any(URI::Generic, String)) + DSL.new(uri, **options) + end + else + DSL.new( + T.must(uri), + verified: verified, + using: using, + tag: tag, + branch: branch, + revisions: revisions, + revision: revision, + trust_cert: trust_cert, + cookies: cookies, + referer: referer, + header: header, + user_agent: user_agent, + data: data, + only_path: only_path, + ) end - else - DSL.new( - T.must(uri), - verified: verified, - using: using, - tag: tag, - branch: branch, - revisions: revisions, - revision: revision, - trust_cert: trust_cert, - cookies: cookies, - referer: referer, - header: header, - user_agent: user_agent, - data: data, - only_path: only_path, - ) - end ) @from_block = !block.nil? diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index b2a9953356..f3f0c2a6d8 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -200,7 +200,7 @@ module Homebrew except: args.except, spdx_license_data: spdx_license_data, spdx_exception_data: spdx_exception_data, - style_offenses: style_offenses ? style_offenses.for_path(f.path) : nil, + style_offenses: style_offenses&.for_path(f.path), display_cop_names: args.display_cop_names?, }.compact diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index bd709195c2..af4a62a787 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -852,7 +852,7 @@ module Homebrew .gsub("This is an unsupported configuration, likely to break in " \ "the future and leave your machine in an unknown state.", "") .gsub("System Integrity Protection status: ", "") - .delete("\t\.") + .delete("\t.") .capitalize .strip else diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 466533d204..642c6c3efa 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -493,7 +493,7 @@ class FormulaInstaller # stop installation from continuing. opoo <<~EOS #{formula}: #{e.message} - 'conflicts_with \"#{c.name}\"' should be removed from #{formula.path.basename}. + 'conflicts_with "#{c.name}"' should be removed from #{formula.path.basename}. EOS raise if Homebrew::EnvConfig.developer? diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index 0f404ac482..ce6a84ee56 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -8,7 +8,6 @@ require "fileutils" require "json" require "json/add/exception" require "ostruct" -require "pp" require "forwardable" # Only require "core_ext" here to ensure we're only requiring the minimum of diff --git a/Library/Homebrew/livecheck/strategy/apache.rb b/Library/Homebrew/livecheck/strategy/apache.rb index fd77fda4ca..43a0705d50 100644 --- a/Library/Homebrew/livecheck/strategy/apache.rb +++ b/Library/Homebrew/livecheck/strategy/apache.rb @@ -70,7 +70,7 @@ module Homebrew regex_prefix = Regexp.escape(match[:prefix] || "").gsub("\\-", "-") # Use `\.t` instead of specific tarball extensions (e.g. .tar.gz) - suffix = match[:suffix]&.sub(Strategy::TARBALL_EXTENSION_REGEX, "\.t") + suffix = match[:suffix]&.sub(Strategy::TARBALL_EXTENSION_REGEX, ".t") regex_suffix = Regexp.escape(suffix || "").gsub("\\-", "-") # Example directory regex: `%r{href=["']?v?(\d+(?:\.\d+)+)/}i` diff --git a/Library/Homebrew/livecheck/strategy/bitbucket.rb b/Library/Homebrew/livecheck/strategy/bitbucket.rb index 0d4fef5a55..437c588d86 100644 --- a/Library/Homebrew/livecheck/strategy/bitbucket.rb +++ b/Library/Homebrew/livecheck/strategy/bitbucket.rb @@ -74,7 +74,7 @@ module Homebrew regex_prefix = Regexp.escape(T.must(match[:prefix])).gsub("\\-", "-") # Use `\.t` instead of specific tarball extensions (e.g. .tar.gz) - suffix = T.must(match[:suffix]).sub(Strategy::TARBALL_EXTENSION_REGEX, "\.t") + suffix = T.must(match[:suffix]).sub(Strategy::TARBALL_EXTENSION_REGEX, ".t") regex_suffix = Regexp.escape(suffix).gsub("\\-", "-") # Example regexes: diff --git a/Library/Homebrew/livecheck/strategy/cpan.rb b/Library/Homebrew/livecheck/strategy/cpan.rb index 84e58e8353..b5a6392559 100644 --- a/Library/Homebrew/livecheck/strategy/cpan.rb +++ b/Library/Homebrew/livecheck/strategy/cpan.rb @@ -60,7 +60,7 @@ module Homebrew regex_prefix = Regexp.escape(T.must(match[:prefix])).gsub("\\-", "-") # Use `\.t` instead of specific tarball extensions (e.g. .tar.gz) - suffix = T.must(match[:suffix]).sub(Strategy::TARBALL_EXTENSION_REGEX, "\.t") + suffix = T.must(match[:suffix]).sub(Strategy::TARBALL_EXTENSION_REGEX, ".t") regex_suffix = Regexp.escape(suffix).gsub("\\-", "-") # Example regex: `/href=.*?Brew[._-]v?(\d+(?:\.\d+)*)\.t/i` diff --git a/Library/Homebrew/livecheck/strategy/pypi.rb b/Library/Homebrew/livecheck/strategy/pypi.rb index 256e4f713b..13e973f633 100644 --- a/Library/Homebrew/livecheck/strategy/pypi.rb +++ b/Library/Homebrew/livecheck/strategy/pypi.rb @@ -65,7 +65,7 @@ module Homebrew values[:url] = "https://pypi.org/project/#{T.must(match[:package_name]).gsub(/%20|_/, "-")}/#files" # Use `\.t` instead of specific tarball extensions (e.g. .tar.gz) - suffix = T.must(match[:suffix]).sub(Strategy::TARBALL_EXTENSION_REGEX, "\.t") + suffix = T.must(match[:suffix]).sub(Strategy::TARBALL_EXTENSION_REGEX, ".t") regex_suffix = Regexp.escape(suffix).gsub("\\-", "-") # Example regex: `%r{href=.*?/packages.*?/example[._-]v?(\d+(?:\.\d+)*(?:[._-]post\d+)?)\.t}i` diff --git a/Library/Homebrew/sandbox.rb b/Library/Homebrew/sandbox.rb index 6525a2f750..ccd46a2735 100644 --- a/Library/Homebrew/sandbox.rb +++ b/Library/Homebrew/sandbox.rb @@ -202,7 +202,7 @@ class Sandbox def path_filter(path, type) case type - when :regex then "regex \#\"#{path}\"" + when :regex then "regex #\"#{path}\"" when :subpath then "subpath \"#{expand_realpath(Pathname.new(path))}\"" when :literal, nil then "literal \"#{expand_realpath(Pathname.new(path))}\"" end diff --git a/Library/Homebrew/test/cask/cmd/reinstall_spec.rb b/Library/Homebrew/test/cask/cmd/reinstall_spec.rb index 723d767b17..de00b98822 100644 --- a/Library/Homebrew/test/cask/cmd/reinstall_spec.rb +++ b/Library/Homebrew/test/cask/cmd/reinstall_spec.rb @@ -37,7 +37,7 @@ describe Cask::Cmd::Reinstall, :cask do ==> Removing App '.*Caffeine.app' ==> Dispatching zap stanza ==> Trashing files: - .*org\.example\.caffeine\.plist + .*org.example.caffeine.plist ==> Removing all staged versions of Cask 'local-caffeine' ==> Installing Cask local-caffeine ==> Moving App 'Caffeine.app' to '.*Caffeine.app' diff --git a/Library/Homebrew/test/livecheck/livecheck_spec.rb b/Library/Homebrew/test/livecheck/livecheck_spec.rb index c23f2391b9..bf436ab1aa 100644 --- a/Library/Homebrew/test/livecheck/livecheck_spec.rb +++ b/Library/Homebrew/test/livecheck/livecheck_spec.rb @@ -51,7 +51,7 @@ describe Homebrew::Livecheck do livecheck do url "https://formulae.brew.sh/api/formula/ruby.json" - regex(/"stable":"(\d+(?:\.\d+)+)"/i) + regex(/"stable":"(\d+(?:.\d+)+)"/i) end end RUBY @@ -227,7 +227,7 @@ describe Homebrew::Livecheck do livecheck do url "https://formulae.brew.sh/api/formula/ruby.json" - regex(/"stable":"(\d+(?:\.\d+)+)"/i) + regex(/"stable":"(\d+(?:.\d+)+)"/i) end end RUBY diff --git a/Library/Homebrew/test/rubocops/cask/desc_spec.rb b/Library/Homebrew/test/rubocops/cask/desc_spec.rb index 633db2e1c1..23013c3c29 100644 --- a/Library/Homebrew/test/rubocops/cask/desc_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/desc_spec.rb @@ -17,14 +17,14 @@ describe RuboCop::Cop::Cask::Desc do expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo' do desc 'A bar program' - ^ Description shouldn\'t start with an article. + ^ Description shouldn't start with an article. end RUBY expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo' do desc 'The bar program' - ^^^ Description shouldn\'t start with an article. + ^^^ Description shouldn't start with an article. end RUBY @@ -46,28 +46,28 @@ describe RuboCop::Cop::Cask::Desc do expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foobar' do desc 'Foo-Bar program' - ^^^^^^^ Description shouldn\'t start with the cask name. + ^^^^^^^ Description shouldn't start with the cask name. end RUBY expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo-bar' do desc 'Foo bar program' - ^^^^^^^ Description shouldn\'t start with the cask name. + ^^^^^^^ Description shouldn't start with the cask name. end RUBY expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo-bar' do desc 'Foo-Bar program' - ^^^^^^^ Description shouldn\'t start with the cask name. + ^^^^^^^ Description shouldn't start with the cask name. end RUBY expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo-bar' do desc 'Foo Bar' - ^^^^^^^ Description shouldn\'t start with the cask name. + ^^^^^^^ Description shouldn't start with the cask name. end RUBY end @@ -76,28 +76,28 @@ describe RuboCop::Cop::Cask::Desc do expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo-bar' do desc 'macOS status bar monitor' - ^^^^^ Description shouldn\'t contain the platform. + ^^^^^ Description shouldn't contain the platform. end RUBY expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo-bar' do desc 'Toggles dark mode on Mac OS Mojave' - ^^^^^^ Description shouldn\'t contain the platform. + ^^^^^^ Description shouldn't contain the platform. end RUBY expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo-bar' do desc 'Better input source switcher for OS X' - ^^^^ Description shouldn\'t contain the platform. + ^^^^ Description shouldn't contain the platform. end RUBY expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo-bar' do desc 'Media Manager for Mac OS X' - ^^^^^^^^ Description shouldn\'t contain the platform. + ^^^^^^^^ Description shouldn't contain the platform. end RUBY @@ -110,7 +110,7 @@ describe RuboCop::Cop::Cask::Desc do expect_offense <<~RUBY cask 'foo' do desc 'Application for managing macOS virtual machines on macOS' - ^^^^^ Description shouldn\'t contain the platform. + ^^^^^ Description shouldn't contain the platform. end RUBY diff --git a/Library/Homebrew/test/rubocops/caveats_spec.rb b/Library/Homebrew/test/rubocops/caveats_spec.rb index 1d161b6901..d91e525b47 100644 --- a/Library/Homebrew/test/rubocops/caveats_spec.rb +++ b/Library/Homebrew/test/rubocops/caveats_spec.rb @@ -14,7 +14,7 @@ describe RuboCop::Cop::FormulaAudit::Caveats do url "https://brew.sh/foo-1.0.tgz" def caveats "setuid" - ^^^^^^^^ Don\'t recommend setuid in the caveats, suggest sudo instead. + ^^^^^^^^ Don't recommend setuid in the caveats, suggest sudo instead. end end RUBY diff --git a/Library/Homebrew/test/rubocops/components_order_spec.rb b/Library/Homebrew/test/rubocops/components_order_spec.rb index 20c6736a55..afead946d0 100644 --- a/Library/Homebrew/test/rubocops/components_order_spec.rb +++ b/Library/Homebrew/test/rubocops/components_order_spec.rb @@ -63,7 +63,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do livecheck do ^^^^^^^^^^^^ `livecheck` (line 7) should be put before `bottle` (line 5) url "https://brew.sh/foo/versions/" - regex(/href=.+?foo-(\d+(?:\.\d+)+)\.t/) + regex(/href=.+?foo-(\d+(?:.\d+)+).t/) end end RUBY @@ -75,7 +75,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do livecheck do url "https://brew.sh/foo/versions/" - regex(/href=.+?foo-(\d+(?:\.\d+)+)\.t/) + regex(/href=.+?foo-(\d+(?:.\d+)+).t/) end bottle :unneeded diff --git a/Library/Homebrew/test/rubocops/formula_desc_spec.rb b/Library/Homebrew/test/rubocops/formula_desc_spec.rb index 27280ab5da..f1548f3173 100644 --- a/Library/Homebrew/test/rubocops/formula_desc_spec.rb +++ b/Library/Homebrew/test/rubocops/formula_desc_spec.rb @@ -85,7 +85,7 @@ describe RuboCop::Cop::FormulaAudit::Desc do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' desc 'An aardvark' - ^^ Description shouldn\'t start with an article. + ^^ Description shouldn't start with an article. end RUBY @@ -93,7 +93,7 @@ describe RuboCop::Cop::FormulaAudit::Desc do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' desc 'The aardvark' - ^^^ Description shouldn\'t start with an article. + ^^^ Description shouldn't start with an article. end RUBY end @@ -113,7 +113,7 @@ describe RuboCop::Cop::FormulaAudit::Desc do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' desc 'Foo is a foobar' - ^^^ Description shouldn\'t start with the formula name. + ^^^ Description shouldn't start with the formula name. end RUBY end diff --git a/Library/Homebrew/test/rubocops/lines_spec.rb b/Library/Homebrew/test/rubocops/lines_spec.rb index 10c3c776ea..2fad8c2a79 100644 --- a/Library/Homebrew/test/rubocops/lines_spec.rb +++ b/Library/Homebrew/test/rubocops/lines_spec.rb @@ -12,7 +12,7 @@ describe RuboCop::Cop::FormulaAudit::Lines do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' depends_on :automake - ^^^^^^^^^^^^^^^^^^^^ :automake is deprecated. Usage should be \"automake\". + ^^^^^^^^^^^^^^^^^^^^ :automake is deprecated. Usage should be "automake". end RUBY end @@ -22,7 +22,7 @@ describe RuboCop::Cop::FormulaAudit::Lines do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' depends_on :autoconf - ^^^^^^^^^^^^^^^^^^^^ :autoconf is deprecated. Usage should be \"autoconf\". + ^^^^^^^^^^^^^^^^^^^^ :autoconf is deprecated. Usage should be "autoconf". end RUBY end @@ -32,7 +32,7 @@ describe RuboCop::Cop::FormulaAudit::Lines do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' depends_on :libtool - ^^^^^^^^^^^^^^^^^^^ :libtool is deprecated. Usage should be \"libtool\". + ^^^^^^^^^^^^^^^^^^^ :libtool is deprecated. Usage should be "libtool". end RUBY end @@ -42,7 +42,7 @@ describe RuboCop::Cop::FormulaAudit::Lines do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' depends_on :apr - ^^^^^^^^^^^^^^^ :apr is deprecated. Usage should be \"apr-util\". + ^^^^^^^^^^^^^^^ :apr is deprecated. Usage should be "apr-util". end RUBY end diff --git a/Library/Homebrew/test/rubocops/shell_commands_spec.rb b/Library/Homebrew/test/rubocops/shell_commands_spec.rb index d13592cf9c..0e1885f390 100644 --- a/Library/Homebrew/test/rubocops/shell_commands_spec.rb +++ b/Library/Homebrew/test/rubocops/shell_commands_spec.rb @@ -15,7 +15,7 @@ module RuboCop class Foo < Formula def install system "foo bar" - ^^^^^^^^^ Separate `system` commands into `\"foo\", \"bar\"` + ^^^^^^^^^ Separate `system` commands into `"foo", "bar"` end end RUBY @@ -34,7 +34,7 @@ module RuboCop class Foo < Formula def install system "\#{bin}/foo bar" - ^^^^^^^^^^^^^^^^ Separate `system` commands into `\"\#{bin}/foo\", \"bar\"` + ^^^^^^^^^^^^^^^^ Separate `system` commands into `"\#{bin}/foo", "bar"` end end RUBY @@ -83,7 +83,7 @@ module RuboCop class Foo < Formula def install Utils.popen_read("foo bar") - ^^^^^^^^^ Separate `Utils.popen_read` commands into `\"foo\", \"bar\"` + ^^^^^^^^^ Separate `Utils.popen_read` commands into `"foo", "bar"` end end RUBY @@ -102,7 +102,7 @@ module RuboCop class Foo < Formula def install Utils.safe_popen_read("foo bar") - ^^^^^^^^^ Separate `Utils.safe_popen_read` commands into `\"foo\", \"bar\"` + ^^^^^^^^^ Separate `Utils.safe_popen_read` commands into `"foo", "bar"` end end RUBY @@ -121,7 +121,7 @@ module RuboCop class Foo < Formula def install Utils.popen_write("foo bar") - ^^^^^^^^^ Separate `Utils.popen_write` commands into `\"foo\", \"bar\"` + ^^^^^^^^^ Separate `Utils.popen_write` commands into `"foo", "bar"` end end RUBY @@ -140,7 +140,7 @@ module RuboCop class Foo < Formula def install Utils.safe_popen_write("foo bar") - ^^^^^^^^^ Separate `Utils.safe_popen_write` commands into `\"foo\", \"bar\"` + ^^^^^^^^^ Separate `Utils.safe_popen_write` commands into `"foo", "bar"` end end RUBY @@ -159,7 +159,7 @@ module RuboCop class Foo < Formula def install Utils.popen_read("\#{bin}/foo bar") - ^^^^^^^^^^^^^^^^ Separate `Utils.popen_read` commands into `\"\#{bin}/foo\", \"bar\"` + ^^^^^^^^^^^^^^^^ Separate `Utils.popen_read` commands into `"\#{bin}/foo", "bar"` end end RUBY @@ -198,7 +198,7 @@ module RuboCop class Foo < Formula def install Utils.popen_read({ "SHELL" => "bash"}, "foo bar") - ^^^^^^^^^ Separate `Utils.popen_read` commands into `\"foo\", \"bar\"` + ^^^^^^^^^ Separate `Utils.popen_read` commands into `"foo", "bar"` end end RUBY @@ -222,7 +222,7 @@ module RuboCop expect_offense(<<~RUBY) fork do exec "foo bar > output" - ^^^^^^^^^^^^^^^^^^ Don\'t use shell metacharacters in `exec`. Implement the logic in Ruby instead, using methods like `$stdout.reopen`. + ^^^^^^^^^^^^^^^^^^ Don't use shell metacharacters in `exec`. Implement the logic in Ruby instead, using methods like `$stdout.reopen`. end RUBY end diff --git a/Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb b/Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb index 7482000c2d..0c7d7ee41e 100644 --- a/Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb +++ b/Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb @@ -13,7 +13,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' FileUtils.mv "hello" - ^^^^^^^^^^^^^^^^^^^^ Don\'t need \'FileUtils.\' before mv + ^^^^^^^^^^^^^^^^^^^^ Don't need 'FileUtils.' before mv end RUBY end @@ -24,7 +24,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' inreplace "foo" do |longvar| - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \"inreplace do |s|\" is preferred over \"|longvar|\". + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "inreplace do |s|" is preferred over "|longvar|". somerandomCall(longvar) end end @@ -275,7 +275,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install ENV["COMPILER_PATH"] = "/usr/bin/gcc" - ^^^^^^^^^^^^^^ Use \"\#{ENV.cc}\" instead of hard-coding \"gcc\" + ^^^^^^^^^^^^^^ Use "\#{ENV.cc}" instead of hard-coding "gcc" end end RUBY @@ -339,7 +339,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' depends_on "lpeg" => :lua51 - ^^^^^^ lua modules should be vendored rather than use deprecated `depends_on \"lpeg\" => :lua51` + ^^^^^^ lua modules should be vendored rather than use deprecated `depends_on "lpeg" => :lua51` end RUBY end @@ -413,7 +413,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' needs :openmp - ^^^^^^^^^^^^^ 'needs :openmp' should be replaced with 'depends_on \"gcc\"' + ^^^^^^^^^^^^^ 'needs :openmp' should be replaced with 'depends_on "gcc"' end RUBY end diff --git a/Library/Homebrew/test/rubocops/text/option_declarations_spec.rb b/Library/Homebrew/test/rubocops/text/option_declarations_spec.rb index 818c894e3c..446dc60b22 100644 --- a/Library/Homebrew/test/rubocops/text/option_declarations_spec.rb +++ b/Library/Homebrew/test/rubocops/text/option_declarations_spec.rb @@ -110,7 +110,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def post_install return if build.without? "--without-bar" - ^^^^^^^^^^^^^^^ Don't duplicate 'without': Use `build.without? \"bar\"` to check for \"--without-bar\" + ^^^^^^^^^^^^^^^ Don't duplicate 'without': Use `build.without? "bar"` to check for "--without-bar" end end RUBY @@ -123,7 +123,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def post_install return if build.with? "--with-bar" - ^^^^^^^^^^^^ Don't duplicate 'with': Use `build.with? \"bar\"` to check for \"--with-bar\" + ^^^^^^^^^^^^ Don't duplicate 'with': Use `build.with? "bar"` to check for "--with-bar" end end RUBY diff --git a/Library/Homebrew/test/rubocops/text_spec.rb b/Library/Homebrew/test/rubocops/text_spec.rb index 883aadac88..bd6e48ab26 100644 --- a/Library/Homebrew/test/rubocops/text_spec.rb +++ b/Library/Homebrew/test/rubocops/text_spec.rb @@ -93,7 +93,7 @@ describe RuboCop::Cop::FormulaAudit::Text do def install system "xcodebuild", "foo", "bar" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use \"xcodebuild *args\" instead of \"system 'xcodebuild', *args\" + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use "xcodebuild *args" instead of "system 'xcodebuild', *args" end end RUBY @@ -107,7 +107,7 @@ describe RuboCop::Cop::FormulaAudit::Text do def install system "xcodebuild", "foo", "bar" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use \"xcodebuild *args\" instead of \"system 'xcodebuild', *args\" + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use "xcodebuild *args" instead of "system 'xcodebuild', *args" end def plist @@ -152,7 +152,7 @@ describe RuboCop::Cop::FormulaAudit::Text do def install Formula.factory(name) - ^^^^^^^^^^^^^^^^^^^^^ \"Formula.factory(name)\" is deprecated in favor of \"Formula[name]\" + ^^^^^^^^^^^^^^^^^^^^^ "Formula.factory(name)" is deprecated in favor of "Formula[name]" end end RUBY @@ -166,7 +166,7 @@ describe RuboCop::Cop::FormulaAudit::Text do def install system "dep", "ensure" - ^^^^^^^^^^^^^^^^^^^^^^ use \"dep\", \"ensure\", \"-vendor-only\" + ^^^^^^^^^^^^^^^^^^^^^^ use "dep", "ensure", "-vendor-only" end end RUBY @@ -180,7 +180,7 @@ describe RuboCop::Cop::FormulaAudit::Text do def install system "cargo", "build" - ^^^^^^^^^^^^^^^^^^^^^^^ use \"cargo\", \"install\", *std_cargo_args + ^^^^^^^^^^^^^^^^^^^^^^^ use "cargo", "install", *std_cargo_args end end RUBY diff --git a/Library/Homebrew/test/service_spec.rb b/Library/Homebrew/test/service_spec.rb index b55df5b32b..8a333a59df 100644 --- a/Library/Homebrew/test/service_spec.rb +++ b/Library/Homebrew/test/service_spec.rb @@ -592,8 +592,8 @@ describe Homebrew::Service do StandardInput=file:#{HOMEBREW_PREFIX}/var/in/beanstalkd StandardOutput=append:#{HOMEBREW_PREFIX}/var/log/beanstalkd.log StandardError=append:#{HOMEBREW_PREFIX}/var/log/beanstalkd.error.log - Environment=\"PATH=#{std_path}\" - Environment=\"FOO=BAR\" + Environment="PATH=#{std_path}" + Environment="FOO=BAR" EOS expect(unit).to eq(unit_expect.strip) end diff --git a/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb b/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb index 4058dd0ac2..f2d75d1be1 100644 --- a/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb +++ b/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb @@ -36,7 +36,7 @@ RSpec.shared_context "Homebrew Cask", :needs_macos do # rubocop:disable RSpec/Co third_party_tap = Tap.fetch("third-party", "tap") begin - Cask::Config::DEFAULT_DIRS_PATHNAMES.values.each(&:mkpath) + Cask::Config::DEFAULT_DIRS_PATHNAMES.each_value(&:mkpath) Tap.default_cask_tap.tap do |tap| FileUtils.mkdir_p tap.path.dirname diff --git a/Library/Homebrew/test/utils/tty_spec.rb b/Library/Homebrew/test/utils/tty_spec.rb index 1a717f569d..b9db607c98 100644 --- a/Library/Homebrew/test/utils/tty_spec.rb +++ b/Library/Homebrew/test/utils/tty_spec.rb @@ -4,7 +4,7 @@ describe Tty do describe "::strip_ansi" do it "removes ANSI escape codes from a string" do - expect(described_class.strip_ansi("\033\[36;7mhello\033\[0m")).to eq("hello") + expect(described_class.strip_ansi("\033[36;7mhello\033[0m")).to eq("hello") end end diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index a72fa5ab68..ca04835918 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -535,7 +535,7 @@ module GitHub response = create_fork(tap_remote_repo, org: org) # GitHub API responds immediately but fork takes a few seconds to be ready. sleep 1 until check_fork_exists(tap_remote_repo, org: org) - remote_url = if system("git", "config", "--local", "--get-regexp", "remote\..*\.url", "git@github.com:.*") + remote_url = if system("git", "config", "--local", "--get-regexp", "remote..*.url", "git@github.com:.*") response.fetch("ssh_url") else url = response.fetch("clone_url") diff --git a/Library/Homebrew/utils/pypi.rb b/Library/Homebrew/utils/pypi.rb index 1de0d1abaf..9ca89e555e 100644 --- a/Library/Homebrew/utils/pypi.rb +++ b/Library/Homebrew/utils/pypi.rb @@ -220,9 +220,9 @@ module PyPI pipgrip_output = Utils.popen_read(*command) unless $CHILD_STATUS.success? odie <<~EOS - Unable to determine dependencies for \"#{input_packages.join(" ")}\" because of a failure when running + Unable to determine dependencies for "#{input_packages.join(" ")}" because of a failure when running `#{command.join(" ")}`. - Please update the resources for \"#{formula.name}\" manually. + Please update the resources for "#{formula.name}" manually. EOS end @@ -242,8 +242,8 @@ module PyPI odie "Unable to resolve some dependencies. Please update the resources for \"#{formula.name}\" manually." elsif url.blank? || checksum.blank? odie <<~EOS - Unable to find the URL and/or sha256 for the \"#{name}\" resource. - Please update the resources for \"#{formula.name}\" manually. + Unable to find the URL and/or sha256 for the "#{name}" resource. + Please update the resources for "#{formula.name}" manually. EOS end