1
0
mirror of https://github.com/go-task/task.git synced 2025-08-10 22:42:19 +02:00

feat: decoding improvements (#2068)

* refactor: moved/simplified snippets into its own file with tests

* refactor: move snippet to taskfile package

* feat: support snippets with line/col = 0

* feat: functional options for snippets

* feat: added option to hide snippet indicators

* feat: store raw lines for length calculations

* feat: add debug function for TaskfileDecodeError

* fix: decode errors from commands

* fix: schema for defer cmd calls

* fix: linting issues

* refactor: split var and vars into different files like other structures
This commit is contained in:
Pete Davison
2025-02-22 15:44:22 +00:00
committed by GitHub
parent fb27318601
commit cdb6a3f70a
10 changed files with 753 additions and 282 deletions

View File

@@ -29,6 +29,12 @@
},
{
"$ref": "#/definitions/task_call"
},
{
"$ref": "#/definitions/defer_task_call"
},
{
"$ref": "#/definitions/defer_cmd_call"
}
]
}
@@ -216,7 +222,10 @@
"$ref": "#/definitions/task_call"
},
{
"$ref": "#/definitions/defer_call"
"$ref": "#/definitions/defer_task_call"
},
{
"$ref": "#/definitions/defer_cmd_call"
},
{
"$ref": "#/definitions/for_cmds_call"
@@ -350,15 +359,12 @@
"additionalProperties": false,
"required": ["cmd"]
},
"defer_call": {
"defer_task_call": {
"type": "object",
"properties": {
"defer": {
"description": "Run a command when the task completes. This command will run even when the task fails",
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/task_call"
}
@@ -368,6 +374,21 @@
"additionalProperties": false,
"required": ["defer"]
},
"defer_cmd_call": {
"type": "object",
"properties": {
"defer": {
"description": "Name of the command to defer",
"type": "string"
},
"silent": {
"description": "Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`.",
"type": "boolean"
}
},
"additionalProperties": false,
"required": ["defer"]
},
"for_cmds_call": {
"type": "object",
"properties": {