Repository navigation
Conversation
vmaerten
marked this pull request as ready for review
November 1, 2026 15:06
…act loadsOverride
…nore in a Taskfile override
Member
Author
|
@leaanthony Hey! I gave the override feature a shot! I remember you were pretty interested in it. What do you think of this proposal? Would it fit your needs? cc @andreynering as you also followed the topic |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
Customising a shared Taskfile locally today means copying the whole file over a
.distvariant (see #1873).Solution
When Task discovers the root Taskfile itself, it now also loads an optional
Taskfile.override.ymlnext to it:varsandenvmerge by key with the override winningdotenvfiles are read firstincludescan be added but not redefinedtasksare added or replaced wholeoutput,method,run,interval,set,shopt,use_gitignore) replace the main ones.silentis rejected, since a plain boolean can't express turning it off and the config file already covers it.Naming the file with
--taskfileskips the override; included, remote and stdin Taskfiles never load one.Tasks are replaced whole rather than merged field by field, so #1873's own example (overriding only a task's
env) needs the value moved to a variable. The override'sversionmust share the main Taskfile's major and not be newer, so bumping the shared Taskfile doesn't break local overrides.Examples
Replace a task, add a personal one, change vars and env
Personal dotenv, output style and an extra include
With
API_URL=https://staging.example.comin.envandAPI_URL=http://localhost:8080in.env.local:TODO after merging
Taskfile.override.ymluntil SchemaStore maps it, and the main schema would accept keys the override rejects.Test plan