feat: change XDG taskrc naming (#2391)

This commit is contained in:
Pete Davison
2025-08-20 12:13:26 +01:00
committed by GitHub
parent 72dfec68b0
commit 39462cbfde
4 changed files with 47 additions and 15 deletions

View File

@@ -19,16 +19,21 @@ files.
## File Precedence
Task's configuration files are named `.taskrc.yml` or `.taskrc.yaml`. Task will
automatically look for directories containing files with these names in the
following order with the highest priority first:
Task will automatically look for directories containing configuration files in
the following order with the highest priority first:
- Current directory (or the one specified by the `--taskfile`/`--entrypoint`
flags).
- Each directory walking up the file tree from the current directory (or the one
specified by the `--taskfile`/`--entrypoint` flags) until we reach the user's
home directory or the root directory of that drive.
- `$XDG_CONFIG_HOME/task`.
- The users `$HOME` directory.
- The `$XDG_CONFIG_HOME/task` directory.
Config files in the current directory, its parent folders or home directory
should be called `.taskrc.yml` or `.taskrc.yaml`. Config files in the
`$XDG_CONFIG_HOME/task` directory are named the same way, but should not contain
the `.` prefix.
All config files will be merged together into a unified config, starting with
the lowest priority file in `$XDG_CONFIG_HOME/task` with each subsequent file
@@ -36,7 +41,7 @@ overwriting the previous one if values are set.
For example, given the following files:
```yaml [$XDG_CONFIG_HOME/task/.taskrc.yml]
```yaml [$XDG_CONFIG_HOME/task/taskrc.yml]
# lowest priority global config
option_1: foo
option_2: foo