Merge pull request #2687 from issyl0/fix_formula_description_regex

Match the "formula name in description" on word boundaries
This commit is contained in:
Mike McQuaid 2017-05-29 08:06:27 +01:00 committed by GitHub
commit da39db01a2
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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