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:
@@ -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": {
|
||||
|
Reference in New Issue
Block a user