aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2017-06-03 09:57:26 +0100
committerGitHub2017-06-03 09:57:26 +0100
commitb7d007fb50678a894a8424d7523acc3b2a7574d0 (patch)
treec95f58361b5f51b7ef75ffa3ce83b41240648204 /Library
parent0b66796540ab88362a4f174fdf45ae2d2560a89b (diff)
parent82b113cdd09031ef45111745946d2f12aca97555 (diff)
downloadbrew-b7d007fb50678a894a8424d7523acc3b2a7574d0.tar.bz2
Merge pull request #2724 from MikeMcQuaid/capital-desc
formula_desc_cop: desc should be capitalised.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/rubocops/formula_desc_cop.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/rubocops/formula_desc_cop.rb b/Library/Homebrew/rubocops/formula_desc_cop.rb
index 81068ac34..54a14b39d 100644
--- a/Library/Homebrew/rubocops/formula_desc_cop.rb
+++ b/Library/Homebrew/rubocops/formula_desc_cop.rb
@@ -32,13 +32,18 @@ module RuboCop
# Check if command-line is wrongly used in formula's desc
if match = regex_match_group(desc, /(command ?line)/i)
- problem "Description should use \"command-line\" instead of \"#{match}\""
+ c = match.to_s.chars.first
+ problem "Description should use \"#{c}ommand-line\" instead of \"#{match}\""
end
if match = regex_match_group(desc, /^(an?)\s/i)
problem "Description shouldn't start with an indefinite article (#{match})"
end
+ if regex_match_group(desc, /^[a-z]/)
+ problem "Description should start with a capital letter"
+ 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}\b/i)
end