From 974c54d517ce7069742d80a6228f1887d0fcb998 Mon Sep 17 00:00:00 2001 From: Jakob Haufe Date: Thu, 11 Jan 2024 15:20:25 +0100 Subject: [PATCH] Allow dashes in legacy role namespaces (#3962) Co-authored-by: Sorin Sbarnea --- src/ansiblelint/schemas/meta.json | 2 +- .../meta_invalid_role_namespace/meta/main.yml.md | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/ansiblelint/schemas/meta.json b/src/ansiblelint/schemas/meta.json index f89c860529..7141067a25 100644 --- a/src/ansiblelint/schemas/meta.json +++ b/src/ansiblelint/schemas/meta.json @@ -512,7 +512,7 @@ "namespace": { "markdownDescription": "Used by molecule and ansible-lint to compute FQRN for roles outside collections", "minLength": 2, - "pattern": "^[a-z][a-z0-9_]+$", + "pattern": "^[a-z][a-z0-9_-]+$", "title": "Namespace Name", "type": "string" }, diff --git a/test/schemas/negative_test/roles/meta_invalid_role_namespace/meta/main.yml.md b/test/schemas/negative_test/roles/meta_invalid_role_namespace/meta/main.yml.md index 13db2e0797..73369a2653 100644 --- a/test/schemas/negative_test/roles/meta_invalid_role_namespace/meta/main.yml.md +++ b/test/schemas/negative_test/roles/meta_invalid_role_namespace/meta/main.yml.md @@ -19,15 +19,6 @@ "failingKeyword": "then" }, "schemaPath": "#/allOf/0/if" - }, - { - "instancePath": "/galaxy_info/namespace", - "keyword": "pattern", - "message": "must match pattern \"^[a-z][a-z0-9_]+$\"", - "params": { - "pattern": "^[a-z][a-z0-9_]+$" - }, - "schemaPath": "#/properties/namespace/pattern" } ] ``` @@ -46,12 +37,6 @@ stdout: "path": "$.galaxy_info", "message": "'author' is a required property", "has_sub_errors": false - }, - { - "filename": "negative_test/roles/meta_invalid_role_namespace/meta/main.yml", - "path": "$.galaxy_info.namespace", - "message": "'foo-bar' does not match '^[a-z][a-z0-9_]+$'", - "has_sub_errors": false } ], "parse_errors": []