Add support for customizing default Taskfile name via TASKFILE_DEFAULT_NAME environment variable #2575
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.
Many users prefer the
.yamlextension over.ymlfor YAML files, as it's more explicit and commonly used in various tools and editors (e.g., for better syntax highlighting or consistency with other projects).Currently, running
task --init(ortask -i) always creates a file namedTaskfile.yml, which requires manual renaming for those who preferTaskfile.yaml.This PR introduces a new environment variable,
TASKFILE_DEFAULT_NAME, that allows users to override the default filename generated bytask --init.TASKFILE_DEFAULT_NAMEis set (e.g.,TASKFILE_DEFAULT_NAME=Taskfile.yaml task --init), the init command will create the file with that exact name.Taskfile.yml)..ymlor.yaml) to avoid confusion.This change provides more flexibility for users without altering the default experience or affecting existing Taskfiles. It addresses community feedback around filename preferences (related to discussions in issues like #2008 and historical PRs for
.yamlsupport) in a non-breaking way.No changes to Taskfile detection/loading logic are made—only the init-generated filename is customizable.