From 4f719aafe8f2d7f2002582c617b63a5153896575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Fabianski?= Date: Tue, 10 Oct 2023 10:55:37 +0200 Subject: [PATCH] ci: improve schema --- scripts/{rule_schema.json => rule_schema.jsonc} | 10 +++++++++- scripts/validate.sh | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) rename scripts/{rule_schema.json => rule_schema.jsonc} (97%) diff --git a/scripts/rule_schema.json b/scripts/rule_schema.jsonc similarity index 97% rename from scripts/rule_schema.json rename to scripts/rule_schema.jsonc index 708c99d6c..e3e4a23e9 100644 --- a/scripts/rule_schema.json +++ b/scripts/rule_schema.jsonc @@ -13,7 +13,15 @@ "languages": { "type": "array", "items": { - "type": "string" + "type": "string", + "enum": [ + "sql", // built-in + "ruby", + "java", + "javascript", + "go", + "python" + ] } }, "trigger": { diff --git a/scripts/validate.sh b/scripts/validate.sh index 6d2aa687a..5f9b894fa 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -5,4 +5,4 @@ for rule_file in $(find $PWD/rules -type f | grep .yml | grep -vE '.snapshots|.g args="$args -d $rule_file" done -npx ajv-cli -s scripts/rule_schema.json$args --allow-union-types \ No newline at end of file +npx ajv-cli -s scripts/rule_schema.jsonc$args --allow-union-types \ No newline at end of file