Skip to content

Commit dba964b

Browse files
authored
Merge pull request #910 from go-task/bring-schema-in-house
Bring schema in house
2 parents 8e0816a + 620e695 commit dba964b

File tree

2 files changed

+414
-28
lines changed

2 files changed

+414
-28
lines changed

docs/docs/api_reference.md

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ variable
3535
| `-a` | `--list-all` | `bool` | `false` | Lists tasks with or without a description. |
3636
| `-o` | `--output` | `string` | Default set in the Taskfile or `intervealed` | Sets output style: [`interleaved`/`group`/`prefixed`]. |
3737
| | `--output-group-begin` | `string` | | Message template to print before a task's grouped output. |
38-
| | `--output-group-end ` | `string` | | Message template to print after a task's grouped output. |
38+
| | `--output-group-end` | `string` | | Message template to print after a task's grouped output. |
3939
| `-p` | `--parallel` | `bool` | `false` | Executes tasks provided on command line in parallel. |
4040
| `-s` | `--silent` | `bool` | `false` | Disables echoing. |
4141
| | `--status` | `bool` | `false` | Exits with non-zero exit code if any of the given tasks is not up-to-date. |
@@ -80,16 +80,16 @@ Some environment variables can be overriden to adjust Task behavior.
8080
| Attribute | Type | Default | Description |
8181
| - | - | - | - |
8282
| `version` | `string` | | Version of the Taskfile. The current version is `3`. |
83-
| `includes` | [`map[string]Include`](#include) | | Additional Taskfiles to be included. |
8483
| `output` | `string` | `interleaved` | Output mode. Available options: `interleaved`, `group` and `prefixed`. |
8584
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overriden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
86-
| `silent` | `bool` | `false` | Default "silent" options for this Taskfile. If `false`, can be overidden with `true` in a task by task basis. |
87-
| `run` | `string` | `always` | Default "run" option for this Taskfile. Available options: `always`, `once` and `when_changed`. |
88-
| `interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
89-
| `vars` | [`map[string]Variable`](#variable) | | Global variables. |
90-
| `env` | [`map[string]Variable`](#variable) | | Global environment. |
85+
| `includes` | [`map[string]Include`](#include) | | Additional Taskfiles to be included. |
86+
| `vars` | [`map[string]Variable`](#variable) | | A set of global variables. |
87+
| `env` | [`map[string]Variable`](#variable) | | A set of global environment variables. |
88+
| `tasks` | [`map[string]Task`](#task) | | A set of task definitions. |
89+
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overidden with `true` in a task by task basis. |
9190
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
92-
| `tasks` | [`map[string]Task`](#task) | | The task definitions. |
91+
| `run` | `string` | `always` | Default 'run' option for this Taskfile. Available options: `always`, `once` and `when_changed`. |
92+
| `interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
9393

9494
### Include
9595

@@ -98,8 +98,9 @@ Some environment variables can be overriden to adjust Task behavior.
9898
| `taskfile` | `string` | | The path for the Taskfile or directory to be included. If a directory, Task will look for files named `Taskfile.yml` or `Taskfile.yaml` inside that directory. If a relative path, resolved relative to the directory containing the including Taskfile. |
9999
| `dir` | `string` | The parent Taskfile directory | The working directory of the included tasks when run. |
100100
| `optional` | `bool` | `false` | If `true`, no errors will be thrown if the specified file does not exist. |
101-
| `internal` | `bool` | `false` | If `true`, tasks will not be callable from the command line and will be omitted from both `--list` and `--list-all`. |
101+
| `internal` | `bool` | `false` | Stops any task in the included Taskfile from being callable on the command line. These commands will also be omitted from the output when used with `--list`. |
102102
| `aliases` | `[]string` | | Alternative names for the namespace of the included Taskfile. |
103+
| `vars` | `map[string]Variable` | | A set of variables to apply to the included Taskfile. |
103104

104105
:::info
105106

@@ -116,25 +117,26 @@ includes:
116117
117118
| Attribute | Type | Default | Description |
118119
| - | - | - | - |
119-
| `desc` | `string` | | A short description of the task. This is listed when calling `task --list`. |
120-
| `summary` | `string` | | A longer description of the task. This is listed when calling `task --summary [task]`. |
121-
| `aliases` | `[]string` | | Alternative names for the task. |
120+
| `cmds` | [`[]Command`](#command) | | A list of shell commands to be executed. |
121+
| `deps` | [`[]Dependency`](#dependency) | | A list of dependencies of this task. Tasks defined here will run in parallel before this task. |
122122
| `label` | `string` | | Overrides the name of the task in the output when a task is run. Supports variables. |
123-
| `sources` | `[]string` | | List of sources to check before running this task. Relevant for `checksum` and `timestamp` methods. Can be file paths or star globs. |
124-
| `dir` | `string` | | The current directory which this task should run. |
125-
| `method` | `string` | `checksum` | Method used by this task. Default to the one declared globally or `checksum`. Available options: `checksum`, `timestamp` and `none` |
126-
| `silent` | `bool` | `false` | Skips some output for this task. Note that STDOUT and STDERR of the commands will still be redirected. |
127-
| `internal` | `bool` | `false` | If `true`, this task will not be callable from the command line and will be omitted from both `--list` and `--list-all`. |
123+
| `desc` | `string` | | A short description of the task. This is displayed when calling `task --list`. |
124+
| `summary` | `string` | | A longer description of the task. This is displayed when calling `task --summary [task]`. |
125+
| `aliases` | `[]string` | | A list of alternative names by which the task can be called. |
126+
| `sources` | `[]string` | | A list of sources to check before running this task. Relevant for `checksum` and `timestamp` methods. Can be file paths or star globs. |
127+
| `generates` | `[]string` | | A list of files meant to be generated by this task. Relevant for `timestamp` method. Can be file paths or star globs. |
128+
| `status` | `[]string` | | A list of commands to check if this task should run. The task is skipped otherwise. This overrides `method`, `sources` and `generates`. |
129+
| `preconditions` | [`[]Precondition`](#precondition) | | A list of commands to check if this task should run. If a condition is not met, the task will error. |
130+
| `dir` | `string` | | The directory in which this task should run. Defaults to the current working directory. |
131+
| `vars` | [`map[string]Variable`](#variable) | | A set of variables that can be used in the task. |
132+
| `env` | [`map[string]Variable`](#variable) | | A set of environment variables that will be made available to shell commands. |
133+
| `silent` | `bool` | `false` | Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`. When combined with the `--list` flag, task descriptions will be hidden. |
134+
| `interactive` | `bool` | `false` | Tells task that the command is interactive. |
135+
| `internal` | `bool` | `false` | Stops a task from being callable on the command line. It will also be omitted from the output when used with `--list`. |
136+
| `method` | `string` | `checksum` | Defines which method is used to check the task is up-to-date. `timestamp` will compare the timestamp of the sources and generates files. `checksum` will check the checksum (You probably want to ignore the .task folder in your .gitignore file). `none` skips any validation and always run the task. |
137+
| `prefix` | `string` | | Defines a string to prefix the output of tasks running in parallel. Only used when the output mode is `prefixed`. |
138+
| `ignore_error` | `bool` | `false` | Continue execution if errors happen while executing commands. |
128139
| `run` | `string` | The one declared globally in the Taskfile or `always` | Specifies whether the task should run again or not if called more than once. Available options: `always`, `once` and `when_changed`. |
129-
| `prefix` | `string` | | Allows to override the prefix print before the STDOUT. Only relevant when using the `prefixed` output mode. |
130-
| `ignore_error` | `bool` | `false` | Continue execution if errors happen while executing the commands. |
131-
| `generates` | `[]string` | | List of files meant to be generated by this task. Relevant for `timestamp` method. Can be file paths or star globs. |
132-
| `status` | `[]string` | | List of commands to check if this task should run. The task is skipped otherwise. This overrides `method`, `sources` and `generates`. |
133-
| `preconditions` | [`[]Precondition`](#precondition) | | List of commands to check if this task should run. The task errors otherwise. |
134-
| `vars` | [`map[string]Variable`](#variable) | | Task variables. |
135-
| `env` | [`map[string]Variable`](#variable) | | Task environment. |
136-
| `deps` | [`[]Dependency`](#dependency) | | List of dependencies of this task. |
137-
| `cmds` | [`[]Command`](#command) | | List of commands to be executed. |
138140

139141
:::info
140142

@@ -180,11 +182,11 @@ tasks:
180182
| Attribute | Type | Default | Description |
181183
| - | - | - | - |
182184
| `cmd` | `string` | | The shell command to be executed. |
183-
| `defer` | `string` | | Alternative to `cmd`, but schedules the command to be executed at the end of this task instead of immediately. This cannot be used together with `cmd`. |
184185
| `silent` | `bool` | `false` | Skips some output for this command. Note that STDOUT and STDERR of the commands will still be redirected. |
185-
| `ignore_error` | `bool` | `false` | Continue execution if errors happen while executing the command. |
186186
| `task` | `string` | | Set this to trigger execution of another task instead of running a command. This cannot be set together with `cmd`. |
187187
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to the referenced task. Only relevant when setting `task` instead of `cmd`. |
188+
| `ignore_error` | `bool` | `false` | Continue execution if errors happen while executing the command. |
189+
| `defer` | `string` | | Alternative to `cmd`, but schedules the command to be executed at the end of this task instead of immediately. This cannot be used together with `cmd`. |
188190

189191
:::info
190192

0 commit comments

Comments
 (0)