Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions website/src/docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions website/src/docs/reference/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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`
Expand Down