[PATCH v1 2/5] maintainer_utils: Fix errors in schema.
Richard Earnshaw via Sourceware Forge <[email protected]>
| Newsgroups | gmane.comp.gcc.patches |
|---|---|
| Message-ID | <bmm.hlit9bvuc0.gcc.gcc.rearnsha.222.1.2@forge-stage.sourceware.org> |
From: Richard Earnshaw <[email protected]> Unfortuately some errors crept into the the schema for the maintainers YAML data which meant that some intended checks were being ignored. Specifically: - Arrays with a minimum size need to use minItems - Strings with a minimum length need to use minLength I both cases, case is important (the validator ignores unrecognized tokens). and "minlength" was being used for both strings and arrays. contrib/ChangeLog: * maintainer_utils.py (maintainer_schema): Fix size validation checks. --- contrib/maintainer_utils.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/contrib/maintainer_utils.py b/contrib/maintainer_utils.py index d3af121d075c9..51a78ab72eec7 100755 --- a/contrib/maintainer_utils.py +++ b/contrib/maintainer_utils.py @@ -47,11 +47,11 @@ maintainer_schema = { 'properties': { 'sn': { 'type': 'string', - 'minlength': 1, + 'minLength': 1, }, 'cn': { 'type': 'string', - 'minlength': 1, + 'minLength': 1, }, 'email': { 'type': 'array', @@ -111,23 +111,23 @@ maintainer_schema = { }, ], }, - 'minlength': 1, + 'minItems': 1, }, 'account': { 'type': 'string', - 'minlength': 1, + 'minLength': 1, 'pattern': '[a-zA-Z][a-zA-Z0-9]*', }, 'forgeid': { 'type': 'string', - 'minlength': 1, + 'minLength': 1, }, 'aliases': { 'type': 'array', - 'minlength': 1, + 'minLength': 1, 'items': { 'type': 'string', - 'minlength': 1, + 'minLength': 1, }, }, 'inactive': { @@ -145,28 +145,28 @@ maintainer_schema = { 'properties': { 'name': { 'type': 'string', - 'minlength': 1, + 'minLength': 1, }, 'class': { 'type': 'string', - 'minlength': 1, + 'minLength': 1, }, 'labels': { 'type': 'array', # Disabled until we populate the labels - # 'minlength': 1, + # 'minItems': 1, 'items': { 'type': 'string', - 'minlength': 3, + 'minLength': 3, 'pattern': label_pattern, }, }, 'teams': { 'type': 'array', - 'minlength': 1, + 'minItems': 1, 'items': { 'type': 'string', - 'minlength': 3, + 'minLength': 3, }, }, }, -- 2.54.0