Skip to content

Commit

Permalink
Merge pull request #2687 from issyl0/fix_formula_description_regex
Browse files Browse the repository at this point in the history
Match the "formula name in description" on word boundaries
  • Loading branch information
MikeMcQuaid authored May 29, 2017
2 parents 52b54aa + 279a4df commit da39db0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/rubocops/formula_desc_cop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit da39db0

Please sign in to comment.