formula_desc_cop: empty string is not a valid desc
Just a slightly tweaked version of https://github.com/Homebrew/brew/issues/3286#issuecomment-334983011
This commit is contained in:
parent
e1808bf0e3
commit
075f818118
@ -18,8 +18,14 @@ module RuboCop
|
||||
return
|
||||
end
|
||||
|
||||
# Check if a formula's desc is too long
|
||||
# Check the formula's desc length. Should be >0 and <80 characters.
|
||||
desc = parameters(desc_call).first
|
||||
pure_desc_length = string_content(desc).length
|
||||
if pure_desc_length.zero?
|
||||
problem "The desc (description) should not be an empty string."
|
||||
return
|
||||
end
|
||||
|
||||
desc_length = "#{@formula_name}: #{string_content(desc)}".length
|
||||
max_desc_length = 80
|
||||
return if desc_length <= max_desc_length
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user