Merge pull request #2687 from issyl0/fix_formula_description_regex
Match the "formula name in description" on word boundaries
This commit is contained in:
commit
da39db01a2
@ -40,7 +40,7 @@ module RuboCop
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Check if formula's name is used in formula's desc
|
# 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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -120,7 +120,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do
|
|||||||
source = <<-EOS.undent
|
source = <<-EOS.undent
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'http://example.com/foo-1.0.tgz'
|
||||||
desc 'Foo'
|
desc 'Foo: foobar'
|
||||||
end
|
end
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user