aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2017-05-29 08:06:27 +0100
committerGitHub2017-05-29 08:06:27 +0100
commitda39db01a2a0853f0bb67cfea1fb921084a1d0a8 (patch)
treefde0db1abec84666d9fc097f06faf463e7ab4e1a /Library
parent52b54aaeb9513500331228b9b1efee34f0174880 (diff)
parent279a4df6c3fa41f0b660d67f880ed2bc7c0be848 (diff)
downloadbrew-da39db01a2a0853f0bb67cfea1fb921084a1d0a8.tar.bz2
Merge pull request #2687 from issyl0/fix_formula_description_regex
Match the "formula name in description" on word boundaries
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/rubocops/formula_desc_cop.rb2
-rw-r--r--Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/rubocops/formula_desc_cop.rb b/Library/Homebrew/rubocops/formula_desc_cop.rb
index 1fbf1ddbf..81068ac34 100644
--- a/Library/Homebrew/rubocops/formula_desc_cop.rb
+++ b/Library/Homebrew/rubocops/formula_desc_cop.rb
@@ -40,7 +40,7 @@ module RuboCop
end
# Check if formula's name is used in formula's desc
- problem "Description shouldn't include the formula name" if regex_match_group(desc, /^#{@formula_name}/i)
+ problem "Description shouldn't include the formula name" if regex_match_group(desc, /^#{@formula_name}\b/i)
end
end
end
diff --git a/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb b/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb
index 432b15e3c..bc92291af 100644
--- a/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb
+++ b/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb
@@ -120,7 +120,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do
source = <<-EOS.undent
class Foo < Formula
url 'http://example.com/foo-1.0.tgz'
- desc 'Foo'
+ desc 'Foo: foobar'
end
EOS