formula_desc: handle nil first character.
This commit is contained in:
parent
f951ea83d4
commit
720a00e68e
@ -87,7 +87,7 @@ module RuboCop
|
|||||||
first_word = string_content(node).split.first
|
first_word = string_content(node).split.first
|
||||||
unless VALID_LOWERCASE_WORDS.include?(first_word)
|
unless VALID_LOWERCASE_WORDS.include?(first_word)
|
||||||
first_char = first_word.to_s.chars.first
|
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
|
end
|
||||||
correction.sub!(/^(['"]?)an?\s/i, "\\1")
|
correction.sub!(/^(['"]?)an?\s/i, "\\1")
|
||||||
correction.gsub!(/(ommand ?line)/i, "ommand-line")
|
correction.gsub!(/(ommand ?line)/i, "ommand-line")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user