diff options
| author | ilovezfs | 2017-06-29 09:19:49 -0700 | 
|---|---|---|
| committer | GitHub | 2017-06-29 09:19:49 -0700 | 
| commit | 1503c9fcb2509d099dea8fa0f1ae36b9044152f5 (patch) | |
| tree | 0925a014486b1040d553002af5d834ad5ebef38c | |
| parent | 76ed7898d002ed36e397c908f00589f62b78e641 (diff) | |
| parent | 7013f9dee3ea3e05e0fd51ee6ef0f19e5656176a (diff) | |
| download | brew-1503c9fcb2509d099dea8fa0f1ae36b9044152f5.tar.bz2 | |
Merge pull request #2838 from ilovezfs/allow-formula-name-in-description
formula_desc_cop: allow formula name in desc
| -rw-r--r-- | Library/Homebrew/rubocops/formula_desc_cop.rb | 6 | ||||
| -rw-r--r-- | Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb | 4 | 
2 files changed, 5 insertions, 5 deletions
| diff --git a/Library/Homebrew/rubocops/formula_desc_cop.rb b/Library/Homebrew/rubocops/formula_desc_cop.rb index 3414439b0..619a0cda4 100644 --- a/Library/Homebrew/rubocops/formula_desc_cop.rb +++ b/Library/Homebrew/rubocops/formula_desc_cop.rb @@ -72,9 +72,9 @@ module RuboCop              problem "Description should start with a capital letter"            end -          # Check if formula's name is used in formula's desc -          return unless regex_match_group(desc, /(^|[^a-z])#{@formula_name}([^a-z]|$)/i) -          problem "Description shouldn't include the formula name" +          # Check if formula's desc starts with formula's name +          return unless regex_match_group(desc, /^#{@formula_name} /i) +          problem "Description shouldn't start with the formula name"          end          private diff --git a/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb b/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb index 4e684be46..74ce478fb 100644 --- a/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb @@ -146,11 +146,11 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do        source = <<-EOS.undent          class Foo < Formula            url 'http://example.com/foo-1.0.tgz' -          desc 'Foo: foobar' +          desc 'Foo is a foobar'          end        EOS -      expected_offenses = [{ message: "Description shouldn't include the formula name", +      expected_offenses = [{ message: "Description shouldn't start with the formula name",                               severity: :convention,                               line: 3,                               column: 8, | 
