From 82b113cdd09031ef45111745946d2f12aca97555 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 2 Jun 2017 22:25:07 +0100 Subject: [PATCH] formula_desc_cop: desc should be capitalised. Note that the formula description field should start with a capital letter. --- Library/Homebrew/rubocops/formula_desc_cop.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/rubocops/formula_desc_cop.rb b/Library/Homebrew/rubocops/formula_desc_cop.rb index 81068ac343..54a14b39d3 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