Merge pull request #1363 from reitermarkus/rubocop-percent-literals

Don’t use bare percent literals.
This commit is contained in:
Josh Hagins 2016-10-24 12:29:22 -04:00 committed by GitHub
commit 4f73fa7012
5 changed files with 8 additions and 8 deletions

View File

@ -716,11 +716,11 @@ class FormulaAuditor
end end
if text =~ /system\s+['"]xcodebuild/ if text =~ /system\s+['"]xcodebuild/
problem %(use "xcodebuild *args" instead of "system 'xcodebuild', *args") problem %q(use "xcodebuild *args" instead of "system 'xcodebuild', *args")
end end
if text =~ /xcodebuild[ (]["'*]/ && !text.include?("SYMROOT=") if text =~ /xcodebuild[ (]["'*]/ && !text.include?("SYMROOT=")
problem %(xcodebuild should be passed an explicit "SYMROOT") problem 'xcodebuild should be passed an explicit "SYMROOT"'
end end
if text.include? "Formula.factory(" if text.include? "Formula.factory("
@ -1002,9 +1002,9 @@ class FormulaAuditor
case condition case condition
when /if build\.include\? ['"]with-#{dep}['"]$/, /if build\.with\? ['"]#{dep}['"]$/ when /if build\.include\? ['"]with-#{dep}['"]$/, /if build\.with\? ['"]#{dep}['"]$/
problem %(Replace #{line.inspect} with "depends_on #{quoted_dep} => :optional") problem %Q(Replace #{line.inspect} with "depends_on #{quoted_dep} => :optional")
when /unless build\.include\? ['"]without-#{dep}['"]$/, /unless build\.without\? ['"]#{dep}['"]$/ when /unless build\.include\? ['"]without-#{dep}['"]$/, /unless build\.without\? ['"]#{dep}['"]$/
problem %(Replace #{line.inspect} with "depends_on #{quoted_dep} => :recommended") problem %Q(Replace #{line.inspect} with "depends_on #{quoted_dep} => :recommended")
end end
end end

View File

@ -146,7 +146,7 @@ class DiagnosticChecksTest < Homebrew::TestCase
FileUtils.chmod 0755, file FileUtils.chmod 0755, file
ENV["PATH"] = "#{path}#{File::PATH_SEPARATOR}#{ENV["PATH"]}" ENV["PATH"] = "#{path}#{File::PATH_SEPARATOR}#{ENV["PATH"]}"
assert_match %("config" scripts exist), assert_match '"config" scripts exist',
@checks.check_for_config_scripts @checks.check_for_config_scripts
end end
end end

View File

@ -13,7 +13,7 @@ class ExceptionsTest < Homebrew::TestCase
end end
def test_formula_validation_error def test_formula_validation_error
assert_equal %(invalid attribute for formula 'foo': sha257 ("magic")), assert_equal %q(invalid attribute for formula 'foo': sha257 ("magic")),
FormulaValidationError.new("foo", "sha257", "magic").to_s FormulaValidationError.new("foo", "sha257", "magic").to_s
end end

View File

@ -119,7 +119,7 @@ class ExternalPatchTests < Homebrew::TestCase
end end
def test_inspect def test_inspect
assert_equal %(#<ExternalPatch: :p1 "file:///my.patch">), @p.inspect assert_equal '#<ExternalPatch: :p1 "file:///my.patch">', @p.inspect
end end
def test_cached_download def test_cached_download

View File

@ -35,6 +35,6 @@ I'm not indented
def test_inreplace_sub_failure def test_inreplace_sub_failure
s = "foobar".extend StringInreplaceExtension s = "foobar".extend StringInreplaceExtension
s.sub! "not here", "test" s.sub! "not here", "test"
assert_equal [%(expected replacement of "not here" with "test")], s.errors assert_equal ['expected replacement of "not here" with "test"'], s.errors
end end
end end