diff --git a/Library/Homebrew/rubocops/formula_desc_cop.rb b/Library/Homebrew/rubocops/formula_desc_cop.rb index 1fbf1ddbfcae5..81068ac343087 100644 --- a/Library/Homebrew/rubocops/formula_desc_cop.rb +++ b/Library/Homebrew/rubocops/formula_desc_cop.rb @@ -40,7 +40,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body) 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 432b15e3c813c..bc92291af9ec1 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 @@ class Foo < Formula source = <<-EOS.undent class Foo < Formula url 'http://example.com/foo-1.0.tgz' - desc 'Foo' + desc 'Foo: foobar' end EOS