File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ import { unified } from 'unified';
1414
1515import { BASELINE_LOW_TO_HIGH_DURATION } from 'compute-baseline' ;
1616
17+ // The longest name allowed, to allow for compact display.
18+ const nameMaxLength = 80 ;
19+
1720// The longest description allowed, to avoid them growing into documentation.
1821const descriptionMaxLength = 300 ;
1922
@@ -127,9 +130,12 @@ for (const [key, data] of yamlEntries('feature-group-definitions')) {
127130 data . status . baseline_high_date = String ( highDate ) ;
128131 }
129132
130- // Ensure description is not too long.
133+ // Ensure name and description are not too long.
134+ if ( data . name ?. length > nameMaxLength ) {
135+ throw new Error ( `name in ${ key } .yml is too long, ${ data . name . length } characters. The maximum allowed length is ${ nameMaxLength } .` ) ;
136+ }
131137 if ( data . description ?. length > descriptionMaxLength ) {
132- throw new Error ( `description in ${ key } .yml is too long, ${ data . description . length } characters. The maximum allowed length is ${ descriptionMaxLength } .` )
138+ throw new Error ( `description in ${ key } .yml is too long, ${ data . description . length } characters. The maximum allowed length is ${ descriptionMaxLength } .` ) ;
133139 }
134140
135141 // Ensure that only known group and snapshot identifiers are used.
You can’t perform that action at this time.
0 commit comments