From 720a00e68ead46fe9669dc2fce355dbf2d3a0d09 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 7 Jul 2020 11:30:24 +0100 Subject: [PATCH] formula_desc: handle `nil` first character. --- Library/Homebrew/rubocops/formula_desc.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/rubocops/formula_desc.rb b/Library/Homebrew/rubocops/formula_desc.rb index eb32fcc358..fbd3ef9aac 100644 --- a/Library/Homebrew/rubocops/formula_desc.rb +++ b/Library/Homebrew/rubocops/formula_desc.rb @@ -87,7 +87,7 @@ module RuboCop first_word = string_content(node).split.first unless VALID_LOWERCASE_WORDS.include?(first_word) first_char = first_word.to_s.chars.first - correction.sub!(/^(['"]?)([a-z])/, "\\1#{first_char.upcase}") + correction.sub!(/^(['"]?)([a-z])/, "\\1#{first_char.upcase}") if first_char end correction.sub!(/^(['"]?)an?\s/i, "\\1") correction.gsub!(/(ommand ?line)/i, "ommand-line")