param: limit short description lenght to 150 for existing, 70 for yaml

This commit is contained in:
Beat Küng 2021-03-23 16:20:47 +01:00 committed by Daniel Agar
parent 629f7ba15b
commit 2dace0c9ea
2 changed files with 4 additions and 0 deletions

View File

@ -307,6 +307,8 @@ class SourceParser(object):
if short_desc is not None:
if '\n' in short_desc:
raise Exception('short description must be a single line (parameter: {:})'.format(name))
if len(short_desc) > 150:
raise Exception('short description too long (150 max, is {:}, parameter: {:})'.format(len(short_desc), name))
param.SetField("short_desc", self.re_remove_dots.sub('', short_desc))
if long_desc is not None:
long_desc = self.re_remove_carriage_return.sub(' ', long_desc)

View File

@ -111,6 +111,8 @@ parameters:
# Short description (one line)
type: string
required: true
maxlength: 70
regex: '[^\n]+'
long:
# Long description (can be multiple lines)
type: string