mirror of
https://github.com/go-task/task.git
synced 2026-08-29 10:08:27 +02:00
docs: document use_gitignore in schema reference and guide (#2957)
Co-authored-by: no-hup <shauryaj.finance@gmail.com>
This commit is contained in:
@@ -898,6 +898,16 @@ of the running the task is considered as a generate.
|
||||
|
||||
:::
|
||||
|
||||
::: tip
|
||||
|
||||
If your globs match files that are ignored by Git (build artifacts, caches,
|
||||
etc.), you can set `use_gitignore: true` at the root of your Taskfile to
|
||||
exclude anything matched by `.gitignore` rules from `sources` and `generates`
|
||||
resolution. The setting can also be enabled or disabled per task, which takes
|
||||
precedence over the root value.
|
||||
|
||||
:::
|
||||
|
||||
### Using programmatic checks to indicate a task is up to date
|
||||
|
||||
Alternatively, you can inform a sequence of tests as `status`. If no error is
|
||||
|
||||
@@ -208,6 +208,17 @@ set: [errexit, nounset, pipefail]
|
||||
shopt: [globstar]
|
||||
```
|
||||
|
||||
### `use_gitignore`
|
||||
|
||||
- **Type**: `bool`
|
||||
- **Default**: `false`
|
||||
- **Description**: Exclude files matched by `.gitignore` rules when resolving
|
||||
`sources` and `generates` globs for all tasks. Can be overridden per task.
|
||||
|
||||
```yaml
|
||||
use_gitignore: true
|
||||
```
|
||||
|
||||
## Include
|
||||
|
||||
Configuration for including external Taskfiles.
|
||||
@@ -624,6 +635,24 @@ tasks:
|
||||
- go build -o app ./cmd
|
||||
```
|
||||
|
||||
#### `use_gitignore`
|
||||
|
||||
- **Type**: `bool`
|
||||
- **Default**: `false`
|
||||
- **Description**: Exclude files matched by `.gitignore` rules when resolving
|
||||
this task's `sources` and `generates` globs. Overrides the root-level
|
||||
`use_gitignore` setting.
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
build:
|
||||
use_gitignore: true
|
||||
sources:
|
||||
- '**/*.go'
|
||||
cmds:
|
||||
- go build ./...
|
||||
```
|
||||
|
||||
#### `status`
|
||||
|
||||
- **Type**: `[]string`
|
||||
|
||||
Reference in New Issue
Block a user