From 234352932771676f05d29a56c1c7b4f325079783 Mon Sep 17 00:00:00 2001 From: Valentin Maerten Date: Sun, 14 Dec 2025 10:06:38 +0100 Subject: [PATCH 1/3] fix(schema): workaround IntelliJ JSON Schema validation bug IntelliJ/PhpStorm has a bug (IJPL-63564) where it incorrectly validates YAML files against JSON schemas that use `oneOf` with `required` constraints. This causes false positive "property 'for' is not allowed" warnings. Changes: - Split `for_cmds_call` into `for_cmd_call` and `for_task_call` Each definition now has its own `required` array instead of using `oneOf: [{ required: ["cmd"] }, { required: ["task"] }]` - Fix bug in `for_deps_call` where `oneOf` referenced non-existent `cmd` property (deps can only call tasks, not commands) The schema remains semantically equivalent - the `additionalProperties: false` on each split definition ensures mutual exclusivity of cmd/task. --- website/src/public/schema.json | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/website/src/public/schema.json b/website/src/public/schema.json index a7faa3a973..f47f769eb1 100644 --- a/website/src/public/schema.json +++ b/website/src/public/schema.json @@ -233,7 +233,10 @@ "$ref": "#/definitions/defer_cmd_call" }, { - "$ref": "#/definitions/for_cmds_call" + "$ref": "#/definitions/for_cmd_call" + }, + { + "$ref": "#/definitions/for_task_call" } ] }, @@ -401,7 +404,7 @@ "additionalProperties": false, "required": ["defer"] }, - "for_cmds_call": { + "for_cmd_call": { "type": "object", "properties": { "for": { @@ -415,6 +418,20 @@ "description": "Silent mode disables echoing of command before Task runs it", "type": "boolean" }, + "platforms": { + "description": "Specifies which platforms the command should be run on.", + "$ref": "#/definitions/platforms" + } + }, + "additionalProperties": false, + "required": ["for", "cmd"] + }, + "for_task_call": { + "type": "object", + "properties": { + "for": { + "$ref": "#/definitions/for" + }, "task": { "description": "Task to run", "type": "string" @@ -423,14 +440,17 @@ "description": "Values passed to the task called", "$ref": "#/definitions/vars" }, + "silent": { + "description": "Silent mode disables echoing of command before Task runs it", + "type": "boolean" + }, "platforms": { "description": "Specifies which platforms the command should be run on.", "$ref": "#/definitions/platforms" } }, - "oneOf": [{ "required": ["cmd"] }, { "required": ["task"] }], "additionalProperties": false, - "required": ["for"] + "required": ["for", "task"] }, "for_deps_call": { "type": "object", @@ -451,9 +471,8 @@ "$ref": "#/definitions/vars" } }, - "oneOf": [{ "required": ["cmd"] }, { "required": ["task"] }], "additionalProperties": false, - "required": ["for"] + "required": ["for", "task"] }, "for": { "anyOf": [ From 2585bdccc4f4fb79c256603e59779796cca6d905 Mon Sep 17 00:00:00 2001 From: Valentin Maerten Date: Sun, 14 Dec 2025 10:34:39 +0100 Subject: [PATCH 2/3] fix(schema): allow numbers in for loop lists --- website/src/public/schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/public/schema.json b/website/src/public/schema.json index f47f769eb1..888052d5ae 100644 --- a/website/src/public/schema.json +++ b/website/src/public/schema.json @@ -494,7 +494,7 @@ "description": "A list of values to iterate over", "type": "array", "items": { - "type": "string" + "type": ["string", "number"] } }, "for_attribute": { From ea86ffb39772e5680ed7e29c066d10bb756fa705 Mon Sep 17 00:00:00 2001 From: Valentin Maerten Date: Mon, 15 Dec 2025 22:59:48 +0100 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 878be69ca5..a6c089220d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,8 @@ (e.g., URLs or namespaced functions) (#2101, #2573 by @vmaerten). - The `--yes` flag is now accessible in templates via the new `CLI_ASSUME_YES` variable (#2577, #2479 by @semihbkgr). +- Fixed false positive "property 'for' is not allowed" warnings in IntelliJ when + using `for` loops in Taskfiles (#2576 by @vmaerten). ## v3.45.5 - 2025-11-11