Go API Documentation

github.com/go-task/task/v3

No package summary is available.

Package

Files: 15. Third party imports: 8. Imports from organisation: 0. Tests: 0. Benchmarks: 0.

Constants

Vars

ErrPreconditionFailed is returned when a precondition fails

Types

Call

Call is the parameters to a task call

Field name Field type Comment
Task

string

No comment on field.
Vars

*ast.Vars

No comment on field.
Silent

bool

No comment on field.
Indirect

bool

No comment on field.

Compiler

This type doesn't have documentation.

Field name Field type Comment
Dir

string

No comment on field.
Entrypoint

string

No comment on field.
UserWorkingDir

string

No comment on field.
TaskfileEnv

*ast.Vars

No comment on field.
TaskfileVars

*ast.Vars

No comment on field.
Logger

*logger.Logger

No comment on field.
dynamicCache

map[string]string

No comment on field.
muDynamicCache

sync.Mutex

No comment on field.

FilterFunc

This type doesn't have documentation.

Field name Field type Comment
type

func(task *ast.Task) bool

No comment on field.

ListOptions

ListOptions collects list-related options

Field name Field type Comment
ListOnlyTasksWithDescriptions

bool

No comment on field.
ListAllTasks

bool

No comment on field.
FormatTaskListAsJSON

bool

No comment on field.
NoStatus

bool

No comment on field.

MatchingTask

MatchingTask represents a task that matches a given call. It includes the task itself and a list of wildcards that were matched.

Field name Field type Comment
Task

*ast.Task

No comment on field.
Wildcards

[]string

No comment on field.

ExecutorOption, Executor, TempDir

This type doesn't have documentation.

Field name Field type Comment
type

any

No comment on field.
Dir

string

Flags

Entrypoint

string

No comment on field.
TempDir

TempDir

No comment on field.
Force

bool

No comment on field.
ForceAll

bool

No comment on field.
Insecure

bool

No comment on field.
Download

bool

No comment on field.
Offline

bool

No comment on field.
Timeout

time.Duration

No comment on field.
CacheExpiryDuration

time.Duration

No comment on field.
Watch

bool

No comment on field.
Verbose

bool

No comment on field.
Silent

bool

No comment on field.
AssumeYes

bool

No comment on field.
AssumeTerm

bool

No comment on field.
Dry

bool

No comment on field.
Summary

bool

No comment on field.
Parallel

bool

No comment on field.
Color

bool

No comment on field.
Concurrency

int

No comment on field.
Interval

time.Duration

No comment on field.
Stdin

io.Reader

I/O

Stdout

io.Writer

No comment on field.
Stderr

io.Writer

No comment on field.
Taskfile

*ast.Taskfile

Internal

Logger

*logger.Logger

No comment on field.
Compiler

*Compiler

No comment on field.
Output

output.Output

No comment on field.
OutputStyle

ast.Output

No comment on field.
TaskSorter

sort.Sorter

No comment on field.
UserWorkingDir

string

No comment on field.
EnableVersionCheck

bool

No comment on field.
fuzzyModel

*fuzzy.Model

No comment on field.
concurrencySemaphore

chan struct{}

No comment on field.
taskCallCount

map[string]*int32

No comment on field.
mkdirMutexMap

map[string]*sync.Mutex

No comment on field.
executionHashes

map[string]context.Context

No comment on field.
executionHashesMutex

sync.Mutex

No comment on field.
watchedDirs

*xsync.MapOf[string, bool]

No comment on field.
Remote

string

No comment on field.
Fingerprint

string

No comment on field.

assumeTermOption

This type doesn't have documentation.

Field name Field type Comment
assumeTerm

bool

No comment on field.

assumeYesOption

This type doesn't have documentation.

Field name Field type Comment
assumeYes

bool

No comment on field.

cacheExpiryDurationOption

This type doesn't have documentation.

Field name Field type Comment
duration

time.Duration

No comment on field.

colorOption

This type doesn't have documentation.

Field name Field type Comment
color

bool

No comment on field.

concurrencyOption

This type doesn't have documentation.

Field name Field type Comment
concurrency

int

No comment on field.

dirOption

This type doesn't have documentation.

Field name Field type Comment
dir

string

No comment on field.

downloadOption

This type doesn't have documentation.

Field name Field type Comment
download

bool

No comment on field.

dryOption

This type doesn't have documentation.

Field name Field type Comment
dry

bool

No comment on field.

entrypointOption

This type doesn't have documentation.

Field name Field type Comment
entrypoint

string

No comment on field.

forceAllOption

This type doesn't have documentation.

Field name Field type Comment
forceAll

bool

No comment on field.

forceOption

This type doesn't have documentation.

Field name Field type Comment
force

bool

No comment on field.

insecureOption

This type doesn't have documentation.

Field name Field type Comment
insecure

bool

No comment on field.

intervalOption

This type doesn't have documentation.

Field name Field type Comment
interval

time.Duration

No comment on field.

ioOption

This type doesn't have documentation.

Field name Field type Comment
rw

io.ReadWriter

No comment on field.

offlineOption

This type doesn't have documentation.

Field name Field type Comment
offline

bool

No comment on field.

outputStyleOption

This type doesn't have documentation.

Field name Field type Comment
outputStyle

ast.Output

No comment on field.

parallelOption

This type doesn't have documentation.

Field name Field type Comment
parallel

bool

No comment on field.

silentOption

This type doesn't have documentation.

Field name Field type Comment
silent

bool

No comment on field.

stderrOption

This type doesn't have documentation.

Field name Field type Comment
stderr

io.Writer

No comment on field.

stdinOption

This type doesn't have documentation.

Field name Field type Comment
stdin

io.Reader

No comment on field.

stdoutOption

This type doesn't have documentation.

Field name Field type Comment
stdout

io.Writer

No comment on field.

summaryOption

This type doesn't have documentation.

Field name Field type Comment
summary

bool

No comment on field.

taskSorterOption

This type doesn't have documentation.

Field name Field type Comment
sorter

sort.Sorter

No comment on field.

tempDirOption

This type doesn't have documentation.

Field name Field type Comment
tempDir

TempDir

No comment on field.

timeoutOption

This type doesn't have documentation.

Field name Field type Comment
timeout

time.Duration

No comment on field.

traverseFunc

This type doesn't have documentation.

Field name Field type Comment
type

func(*ast.Task) error

No comment on field.

verboseOption

This type doesn't have documentation.

Field name Field type Comment
verbose

bool

No comment on field.

versionCheckOption

This type doesn't have documentation.

Field name Field type Comment
enableVersionCheck

bool

No comment on field.

watchOption

This type doesn't have documentation.

Field name Field type Comment
watch

bool

No comment on field.

Functions

func Completion

Uses: fmt.Errorf.

func FilterOutInternal

FilterOutInternal removes all tasks that are marked as internal.

func FilterOutNoDesc

FilterOutNoDesc removes all tasks that do not contain a description.

func InitTaskfile

InitTaskfile creates a new Taskfile at path.

path can be either a file path or a directory path. If path is a directory, path/Taskfile.yml will be created.

The final file path is always returned and may be different from the input path.

Uses: errors.TaskfileAlreadyExistsError, filepathext.SmartJoin, os.Stat, os.WriteFile.

func NewExecutor

NewExecutor creates a new [Executor] and applies the given functional options to it.

Uses: ast.Output, context.Context, os.Stderr, os.Stdin, os.Stdout, sort.AlphaNumericWithRootTasksFirst, sync.Mutex, time.Second.

func NewListOptions

NewListOptions creates a new ListOptions instance

func ShouldIgnore

Uses: fmt.Sprintf, strings.Contains, strings.HasSuffix.

func WithAssumeTerm

WithAssumeTerm is used for testing purposes to simulate a terminal.

func WithAssumeYes

WithAssumeYes tells the [Executor] to assume "yes" for all prompts.

func WithCacheExpiryDuration

WithCacheExpiryDuration sets the duration after which the cache is considered expired. By default, the cache is considered expired after 24 hours.

func WithColor

WithColor tells the [Executor] whether or not to output using colorized strings.

func WithConcurrency

WithConcurrency sets the maximum number of tasks that the [Executor] can run in parallel.

func WithDir

WithDir sets the working directory of the [Executor]. By default, the directory is set to the user's current working directory.

func WithDownload

WithDownload forces the [Executor] to download a fresh copy of the taskfile from the remote source.

func WithDry

WithDry tells the [Executor] to output the commands that would be run without actually running them.

func WithEntrypoint

WithEntrypoint sets the entrypoint (main Taskfile) of the [Executor]. By default, Task will search for one of the default Taskfiles in the given directory.

func WithForce

WithForce ensures that the [Executor] always runs a task, even when fingerprinting or prompts would normally stop it.

func WithForceAll

WithForceAll ensures that the [Executor] always runs all tasks (including subtasks), even when fingerprinting or prompts would normally stop them.

func WithIO

WithIO sets the [Executor]'s standard input, output, and error to the same [io.ReadWriter].

func WithInsecure

WithInsecure allows the [Executor] to make insecure connections when reading remote taskfiles. By default, insecure connections are rejected.

func WithInterval

WithInterval sets the interval at which the [Executor] will wait for duplicated events before running a task.

func WithOffline

WithOffline stops the [Executor] from being able to make network connections. It will still be able to read local files and cached copies of remote files.

func WithOutputStyle

WithOutputStyle sets the output style of the [Executor]. By default, the output style is set to the style defined in the Taskfile.

func WithParallel

WithParallel tells the [Executor] to run tasks given in the same call in parallel.

func WithSilent

WithSilent tells the [Executor] to suppress all output except for the output of the tasks that are run.

func WithStderr

WithStderr sets the [Executor]'s standard error [io.Writer].

func WithStdin

WithStdin sets the [Executor]'s standard input [io.Reader].

func WithStdout

WithStdout sets the [Executor]'s standard output [io.Writer].

func WithSummary

WithSummary tells the [Executor] to output a summary of the given tasks instead of running them.

func WithTaskSorter

WithTaskSorter sets the sorter that the [Executor] will use to sort tasks. By default, the sorter is set to sort tasks alphabetically, but with tasks with no namespace (in the root Taskfile) first.

func WithTempDir

WithTempDir sets the temporary directory that will be used by [Executor] for storing temporary files like checksums and cached remote files. By default, the temporary directory is set to the user's temporary directory.

func WithTimeout

WithTimeout sets the [Executor]'s timeout for fetching remote taskfiles. By default, the timeout is set to 10 seconds.

func WithVerbose

WithVerbose tells the [Executor] to output more information about the tasks that are run.

func WithVersionCheck

WithVersionCheck tells the [Executor] whether or not to check the version of

func WithWatch

WithWatch tells the [Executor] to keep running in the background and watch for changes to the fingerprint of the tasks that are run. When changes are detected, a new task run is triggered.

func (*Compiler) FastGetVariables

func (*Compiler) GetTaskfileVariables

func (*Compiler) GetVariables

func (*Compiler) HandleDynamicVar

Uses: bytes.Buffer, context.Background, execext.RunCommand, execext.RunCommandOptions, fmt.Errorf, logger.Magenta, strings.TrimSuffix.

func (*Compiler) ResetCache

ResetCache clear the dynamic variables cache

func (*Executor) CompiledTask

CompiledTask returns a copy of a task, but replacing variables in almost all properties using the Go template package.

func (*Executor) FastCompiledTask

FastCompiledTask is like CompiledTask, but it skippes dynamic variables.

func (*Executor) FindMatchingTasks

FindMatchingTasks returns a list of tasks that match the given call. A task matches a call if its name is equal to the call's task name or if it matches a wildcard pattern. The function returns a list of MatchingTask structs, each containing a task and a list of wildcards that were matched.

func (*Executor) GetHash

Uses: cmp.Or, fmt.Errorf, hash.Empty, hash.Hash, hash.HashFunc, hash.Name.

func (*Executor) GetTask

GetTask will return the task with the name matching the given call from the taskfile. If no task is found, it will search for tasks with a matching alias. If multiple tasks contain the same alias or no matches are found an error is returned.

Uses: ast.NewVars, ast.Task, ast.Var, errors.TaskNameConflictError, errors.TaskNotFoundError, slices.Contains.

func (*Executor) GetTaskList

Uses: ast.Task, errgroup.Group, sort.AlphaNumericWithRootTasksFirst.

func (*Executor) InterceptInterruptSignals

NOTE(@andreynering): This function intercepts SIGINT and SIGTERM signals so the Task process is not killed immediately and processes running have time to do cleanup work.

Uses: logger.Red, logger.Yellow, os.Exit, os.Interrupt, os.Signal, signal.Notify, syscall.SIGTERM.

func (*Executor) ListTaskNames

ListTaskNames prints only the task names in a Taskfile. Only tasks with a non-empty description are printed if allTasks is false. Otherwise, all task names are printed.

Uses: fmt.Fprintln, io.Writer, os.Stdout, sort.AlphaNumericWithRootTasksFirst, strings.TrimRight.

func (*Executor) ListTasks

ListTasks prints a list of tasks. Tasks that match the given filters will be excluded from the list. The function returns a boolean indicating whether tasks were found and an error if one was encountered while preparing the output.

Uses: fmt.Fprint, json.NewEncoder, logger.Cyan, logger.Default, logger.Green, logger.Yellow, strings.Join, strings.ReplaceAll, tabwriter.NewWriter.

func (*Executor) Options

Options loops through the given [ExecutorOption] functions and applies them to the [Executor].

func (*Executor) Run

Run runs Task

Uses: errgroup.WithContext, errors.TaskInternalError, errors.TaskNotFoundError, summary.PrintSpaceBetweenSummaries, summary.PrintTask.

func (*Executor) RunTask

RunTask runs a task by its name

Uses: atomic.AddInt32, context.Context, errors.Is, errors.TaskCalledTooManyTimesError, errors.TaskCancelledByUserError, errors.TaskCancelledNoTerminalError, errors.TaskRunError, fingerprint.IsTaskUpToDate, fingerprint.WithDry, fingerprint.WithLogger, fingerprint.WithMethod, fingerprint.WithTempDir, interp.IsExitStatus, logger.ErrNoTerminal, logger.ErrPromptCancelled, logger.Magenta, logger.Red, logger.Yellow.

func (*Executor) Setup

func (*Executor) Status

Status returns an error if any the of given tasks is not up-to-date

Uses: fingerprint.IsTaskUpToDate, fingerprint.WithDry, fingerprint.WithLogger, fingerprint.WithMethod, fingerprint.WithTempDir, fmt.Errorf.

func (*Executor) ToEditorOutput

Uses: context.Background, editors.Location, editors.Task, editors.Taskfile, errgroup.Group, fingerprint.IsTaskUpToDate, fingerprint.WithDry, fingerprint.WithLogger, fingerprint.WithMethod, fingerprint.WithTempDir.

func (*assumeTermOption) ApplyToExecutor

func (*assumeYesOption) ApplyToExecutor

func (*cacheExpiryDurationOption) ApplyToExecutor

func (*colorOption) ApplyToExecutor

func (*concurrencyOption) ApplyToExecutor

func (*dirOption) ApplyToExecutor

func (*downloadOption) ApplyToExecutor

func (*dryOption) ApplyToExecutor

func (*entrypointOption) ApplyToExecutor

func (*forceAllOption) ApplyToExecutor

func (*forceOption) ApplyToExecutor

func (*insecureOption) ApplyToExecutor

func (*intervalOption) ApplyToExecutor

func (*ioOption) ApplyToExecutor

func (*offlineOption) ApplyToExecutor

func (*outputStyleOption) ApplyToExecutor

func (*parallelOption) ApplyToExecutor

func (*silentOption) ApplyToExecutor

func (*stderrOption) ApplyToExecutor

func (*stdinOption) ApplyToExecutor

func (*stdoutOption) ApplyToExecutor

func (*summaryOption) ApplyToExecutor

func (*taskSorterOption) ApplyToExecutor

func (*tempDirOption) ApplyToExecutor

func (*timeoutOption) ApplyToExecutor

func (*verboseOption) ApplyToExecutor

func (*versionCheckOption) ApplyToExecutor

func (*watchOption) ApplyToExecutor

func (ListOptions) Filters

Filters returns the slice of FilterFunc which filters a list of ast.Task according to the given ListOptions

func (ListOptions) ShouldListTasks

ShouldListTasks returns true if one of the options to list tasks has been set to true

Private functions

func asAnySlice

func closeOnInterrupt

References: os.Exit, os.Interrupt, os.Signal, signal.Notify, syscall.SIGTERM.

func emptyFunc

func isContextError

References: context.Canceled, context.DeadlineExceeded, errors.Is, errors.TaskRunError.

func itemsFromFor

References: errors.New, errors.TaskfileInvalidError, filepath.Rel, fingerprint.Globs, strings.Fields, strings.Split.

func product

product generates the cartesian product of the input map of slices.

References: maps.Copy.

func resolveMatrixRefs

References: fmt.Errorf, templater.ResolveRef.

func shouldRunOnCurrentPlatform

References: runtime.GOARCH, runtime.GOOS.

func getSpecialVars

References: filepath.Dir, filepath.ToSlash, filepathext.SmartJoin, os.Args, version.GetVersion.

func getVariables

References: ast.Var, env.GetEnviron, env.GetFromVars, filepathext.SmartJoin, templater.Cache, templater.Replace, templater.ReplaceVar.

func acquireConcurrencyLimit

func areTaskPreconditionsMet

References: context.Canceled, env.Get, errors.Is, execext.RunCommand, execext.RunCommandOptions, logger.Magenta.

func areTaskRequiredVarsAllowedValuesSet

References: errors.NotAllowedVar, errors.TaskNotAllowedVarsError, slices.Contains.

func areTaskRequiredVarsSet

References: errors.MissingVar, errors.TaskMissingRequiredVarsError.

func collectSources

References: ast.Task, fingerprint.Globs, slicesext.UniqueJoin.

func compiledTask

References: ast.Cmd, ast.Dep, ast.NewVars, ast.Precondition, ast.Task, ast.Var, ast.Vars, env.GetFromVars, execext.ExpandLiteral, filepathext.SmartJoin, fingerprint.NewChecksumChecker, fingerprint.NewTimestampChecker, fingerprint.SourcesCheckable, godotenv.Read, os.IsNotExist, os.Stat, strings.ToUpper, templater.Cache, templater.Replace, templater.ReplaceGlobs, templater.ReplaceVars, templater.ReplaceVarsWithExtra, templater.ReplaceWithExtra.

func doVersionChecks

References: ast.V3, errors.TaskfileVersionCheckError, fmt.Sprintf, version.GetVersion.

func getRootNode

References: taskfile.NewRootNode.

func mkdir

References: os.IsNotExist, os.MkdirAll, os.Stat.

func readDotEnvFiles

References: ast.V3, taskfile.Dotenv.

func readTaskfile

References: context.Background, context.DeadlineExceeded, context.WithTimeout, errors.Is, errors.TaskfileNetworkTimeoutError, logger.Magenta, logger.Yellow, taskfile.NewReader, taskfile.WithCacheExpiryDuration, taskfile.WithDebugFunc, taskfile.WithDownload, taskfile.WithInsecure, taskfile.WithOffline, taskfile.WithPromptFunc, taskfile.WithTempDir.

func registerWatchedDirs

References: filepath.Dir, filepath.Rel, logger.Green.

func releaseConcurrencyLimit

func runCommand

References: env.Get, execext.RunCommand, execext.RunCommandOptions, fmt.Errorf, interp.IsExitStatus, logger.Green, logger.Red, logger.Yellow, output.Interleaved, slicesext.UniqueJoin, templater.Cache.

func runDeferred

References: context.Background, context.WithCancel, fmt.Sprintf, logger.Yellow, templater.Cache, templater.ReplaceVarsWithExtra, templater.ReplaceWithExtra.

func runDeps

References: errgroup.WithContext.

func setupCompiler

References: os.Getwd.

func setupConcurrencyState

References: context.Context, sync.Mutex.

func setupDefaults

func setupFuzzyModel

References: fuzzy.NewModel, slices.Concat.

func setupLogger

References: logger.Logger.

func setupOutput

References: output.BuildFor.

func setupStdFiles

References: os.Stderr, os.Stdin, os.Stdout.

func setupTempDir

References: env.GetTaskEnv, execext.ExpandLiteral, filepath.Abs, filepath.Base, filepath.IsAbs, filepathext.SmartJoin, strings.HasPrefix.

func splitRegularAndWatchCalls

func startExecution

References: context.WithCancel, logger.Magenta.

func statusOnError

References: fingerprint.NewSourcesChecker.

func traverse

func watchTasks

watchTasks start watching the given tasks

References: context.Background, context.WithCancel, filepath.Rel, filepathext.SmartJoin, fsnotify.NewWatcher, fsnotify.Remove, fsnotifyext.NewDeduper, logger.Green, logger.Magenta, logger.Red, slices.Contains, strings.Join, time.Duration, time.Second, time.Sleep.


Tests

Files: 4. Third party imports: 4. Imports from organisation: 0. Tests: 112. Benchmarks: 0.

Types

PostProcessFn

A PostProcessFn is a function that can be applied to the output of a test fixture before the file is written.

Field name Field type Comment
type

func(*testing.T, []byte) []byte

No comment on field.

SyncBuffer

SyncBuffer is a threadsafe buffer for testing. Some times replace stdout/stderr with a buffer to capture output. stdout and stderr are threadsafe, but a regular bytes.Buffer is not. Using this instead helps prevents race conditions with output.

Field name Field type Comment
buf

bytes.Buffer

No comment on field.
mu

sync.Mutex

No comment on field.

TestOption, TaskTest

This type doesn't have documentation.

Field name Field type Comment
type

any

No comment on field.
name

string

No comment on field.
experiments

map[*experiments.Experiment]int

No comment on field.
postProcessFns

[]PostProcessFn

No comment on field.
fixtureTemplateData

any

No comment on field.

ExecutorTestOption, ExecutorTest

This type doesn't have documentation.

Field name Field type Comment
type

any

No comment on field.

TaskTest

No comment on field.
task

string

No comment on field.
vars

map[string]any

No comment on field.
input

string

No comment on field.
executorOpts

[]task.ExecutorOption

No comment on field.
wantSetupError

bool

No comment on field.
wantRunError

bool

No comment on field.
wantStatusError

bool

No comment on field.

FormatterTestOption, FormatterTest

This type doesn't have documentation.

Field name Field type Comment
type

any

No comment on field.

TaskTest

No comment on field.
task

string

No comment on field.
vars

map[string]any

No comment on field.
executorOpts

[]task.ExecutorOption

No comment on field.
listOptions

task.ListOptions

No comment on field.
wantSetupError

bool

No comment on field.
wantListError

bool

No comment on field.

executorOptionsTestOption

This type doesn't have documentation.

Field name Field type Comment
executorOpts

[]task.ExecutorOption

No comment on field.

experimentTestOption

This type doesn't have documentation.

Field name Field type Comment
experiment

*experiments.Experiment

No comment on field.
value

int

No comment on field.

fileContentTest

fileContentTest provides a basic reusable test-case for running a Taskfile and inspect generated files.

Field name Field type Comment
Dir

string

No comment on field.
Entrypoint

string

No comment on field.
Target

string

No comment on field.
TrimSpace

bool

No comment on field.
Files

map[string]string

No comment on field.

fixtureTemplateDataTestOption

This type doesn't have documentation.

Field name Field type Comment
data

any

No comment on field.

inputTestOption

This type doesn't have documentation.

Field name Field type Comment
input

string

No comment on field.

listErrorTestOption

This type doesn't have documentation.

listOptionsTestOption

This type doesn't have documentation.

Field name Field type Comment
listOptions

task.ListOptions

No comment on field.

nameTestOption

This type doesn't have documentation.

Field name Field type Comment
name

string

No comment on field.

postProcessFnTestOption

This type doesn't have documentation.

Field name Field type Comment
fn

PostProcessFn

No comment on field.

runErrorTestOption

This type doesn't have documentation.

setupErrorTestOption

This type doesn't have documentation.

statusErrorTestOption

This type doesn't have documentation.

taskTestOption

This type doesn't have documentation.

Field name Field type Comment
task

string

No comment on field.

varTestOption

This type doesn't have documentation.

Field name Field type Comment
key

string

No comment on field.
value

any

No comment on field.

Test functions

TestAlias

TestBashShellOptsCommandLevel

References: assert.Equal, bytes.Buffer, context.Background, require.NoError.

TestBashShellOptsGlobalLevel

References: assert.Equal, bytes.Buffer, context.Background, require.NoError.

TestBashShellOptsTaskLevel

References: assert.Equal, bytes.Buffer, context.Background, require.NoError.

TestCmdsVariables

References: assert.Contains, bytes.Buffer, context.Background, filepathext.SmartJoin, fmt.Sprintf, os.RemoveAll, os.Stat, require.NoError.

TestConcurrency

TestCyclicDep

References: assert.IsType, context.Background, errors.TaskCalledTooManyTimesError, io.Discard, require.NoError.

TestDeferredCmds

References: assert.Contains, bytes.Buffer, context.Background, require.Error, require.NoError, strings.TrimSpace.

TestDeps

TestDisplaysErrorOnVersion1Schema

References: assert.Regexp, io.Discard, regexp.MustCompile, require.Error.

TestDisplaysErrorOnVersion2Schema

References: assert.Regexp, bytes.Buffer, io.Discard, regexp.MustCompile, require.Error.

TestDotenvHasEnvVarInPath

TestDotenvHasLocalEnvInPath

References: testing.T.

TestDotenvHasLocalVarInPath

References: testing.T.

TestDotenvShouldAllowMissingEnv

References: testing.T.

TestDotenvShouldErrorWhenIncludingDependantDotenvs

References: assert.Contains, bytes.Buffer, require.Error.

TestDotenvShouldIncludeAllEnvFiles

References: testing.T.

TestDry

References: assert.Equal, bytes.Buffer, context.Background, filepathext.SmartJoin, os.Remove, os.Stat, require.NoError, strings.TrimSpace.

TestDryChecksum

References: context.Background, filepathext.SmartJoin, io.Discard, os.Remove, os.Stat, require.Error, require.NoError.

TestDynamicVariablesRunOnTheNewCreatedDir

References: assert.Equal, bytes.Buffer, context.Background, filepath.Base, os.RemoveAll, os.Stat, require.NoError, strings.TrimSuffix.

TestDynamicVariablesShouldRunOnTheTaskDir

References: testing.T.

TestEmptyTask

TestEmptyTaskfile

TestEnv

References: experiments.EnvPrecedence.

TestErrorCode

References: assert.Equal, assert.True, bytes.Buffer, context.Background, errors.TaskRunError, require.Error, require.NoError, testing.T.

TestEvaluateSymlinksInPaths

References: assert.Equal, bytes.Buffer, context.Background, os.RemoveAll, require.NoError, strings.TrimSpace, testing.T.

TestExitCodeOne

References: assert.Equal, bytes.Buffer, context.Background, require.Error, require.NoError, strings.TrimSpace.

TestExitCodeZero

References: assert.Equal, bytes.Buffer, context.Background, require.NoError, strings.TrimSpace.

TestExitImmediately

References: assert.Contains, bytes.Buffer, context.Background, require.Error, require.NoError.

TestExpand

References: assert.Equal, bytes.Buffer, context.Background, os.UserHomeDir, require.NoError, strings.TrimSpace.

TestForCmds

TestForDeps

References: ast.Output.

TestForce

References: bytes.Buffer, context.Background, require.NoError, testing.T.

TestFuzzyModel

TestGenerates

References: bytes.NewBuffer, context.Background, filepathext.SmartJoin, fmt.Sprintf, os.Remove, os.Stat, require.NoError.

TestIgnoreNilElements

References: assert.Equal, bytes.Buffer, context.Background, require.NoError, testing.T.

TestIncludeChecksum

TestIncludeCycle

References: assert.Contains, bytes.Buffer, require.Error.

TestIncludeWithVarsInInclude

References: bytes.Buffer, require.NoError.

TestIncludedTaskfileVarMerging

References: assert.Contains, bytes.Buffer, context.Background, require.NoError, testing.T.

TestIncludedVars

References: assert.Equal, bytes.Buffer, context.Background, require.NoError, strings.TrimSpace.

TestIncludedVarsMultiLevel

References: assert.Equal, bytes.Buffer, context.Background, require.NoError, strings.TrimSpace.

TestIncludes

References: testing.T.

TestIncludesCallingRoot

References: testing.T.

TestIncludesDependencies

References: testing.T.

TestIncludesEmptyMain

References: testing.T.

TestIncludesFlatten

References: assert.Equal, assert.EqualError, bytes.Buffer, context.Background, require.NoError, testing.T.

TestIncludesFromCustomTaskfile

References: testing.T.

TestIncludesHttp

References: assert.Equal, experiments.RemoteTaskfiles, filepath.Abs, filepath.Join, fs.Glob, http.Dir, http.FileServer, httptest.NewServer, os.DirFS, os.RemoveAll, require.NoError, testing.T, time.Minute.

TestIncludesIncorrect

References: assert.Contains, bytes.Buffer, require.Error.

TestIncludesInternal

References: assert.Equal, bytes.Buffer, context.Background, require.Error, require.NoError, testing.T.

TestIncludesInterpolation

References: assert.Equal, bytes.Buffer, context.Background, filepath.Join, require.Error, require.NoError, testing.T.

TestIncludesMultiLevel

References: testing.T.

TestIncludesOptional

References: testing.T.

TestIncludesOptionalExplicitFalse

References: assert.Equal, fmt.Sprintf, io.Discard, os.Getwd, require.Error.

TestIncludesOptionalImplicitFalse

References: assert.Equal, fmt.Sprintf, io.Discard, os.Getwd, require.Error.

TestIncludesRelativePath

References: assert.Contains, bytes.Buffer, context.Background, require.NoError.

TestIncludesRemote

References: assert.Equal, context.Background, experiments.RemoteTaskfiles, filepath.Join, fmt.Sprint, fmt.Sprintf, http.Dir, http.FileServer, httptest.NewServer, os.ReadFile, os.RemoveAll, rand.Int64, require.NoError, strings.TrimSpace, testing.T, time.Minute.

TestIncludesShadowedDefault

References: testing.T.

TestIncludesUnshadowedDefault

References: testing.T.

TestIncludesWithExclude

References: assert.Equal, bytes.Buffer, context.Background, require.Error, require.NoError.

TestInitDir

References: filepathext.SmartJoin, os.Remove, os.Stat.

TestInitFile

References: filepathext.SmartJoin, os.Remove, os.Stat.

TestInternalTask

References: assert.Equal, bytes.Buffer, context.Background, require.Error, require.NoError, testing.T.

TestJsonListFormat

References: filepath.Abs, require.NoError.

TestLabel

TestListAllShowsNoDesc

TestListCanListDescOnly

TestListDescInterpolation

TestNoLabelInList

TestOutputGroup

References: assert.Equal, bytes.Buffer, context.Background, require.NoError, strings.TrimSpace.

TestOutputGroupErrorOnlyShowsOutputOnFailure

References: assert.Contains, assert.NotContains, bytes.Buffer, context.Background, require.Error, require.NoError, strings.TrimSpace.

TestOutputGroupErrorOnlySwallowsOutputOnSuccess

References: assert.Empty, bytes.Buffer, context.Background, require.NoError.

TestPOSIXShellOptsCommandLevel

References: assert.Equal, bytes.Buffer, context.Background, require.NoError.

TestPOSIXShellOptsGlobalLevel

References: assert.Equal, bytes.Buffer, context.Background, require.NoError.

TestPOSIXShellOptsTaskLevel

References: assert.Equal, bytes.Buffer, context.Background, require.NoError.

TestParams

TestPlatforms

References: assert.Equal, bytes.Buffer, context.Background, fmt.Sprintf, require.NoError, runtime.GOOS.

TestPrecondition

TestPromptAssumeYes

TestPromptInSummary

References: testing.T.

TestPromptWithIndirectTask

TestReference

References: cmp.Or.

TestRequires

TestRunOnceSharedDeps

References: assert.Contains, assert.Len, bytes.Buffer, context.Background, regexp.MustCompile, require.NoError.

TestRunOnlyRunsJobsHashOnce

References: testing.T.

TestShortTaskNotation

References: assert.Equal, bytes.Buffer, context.Background, require.NoError.

TestSilence

References: bytes.Buffer, context.Background, require.Empty, require.NoError, require.NotEmpty, require.True.

TestSingleCmdDep

References: testing.T.

TestSpecialVars

References: fmt.Sprintf.

TestSplitArgs

References: assert.Equal, ast.NewVars, ast.Var, bytes.Buffer, context.Background, require.NoError.

TestStatus

References: filepathext.SmartJoin, os.Remove, os.Stat, require.NoError.

TestStatusChecksum

References: assert.Equal, bytes.Buffer, context.Background, filepathext.SmartJoin, os.Remove, os.Stat, require.Error, require.NoError, testing.T.

TestStatusVariables

References: assert.Contains, bytes.Buffer, context.Background, filepathext.SmartJoin, fmt.Sprintf, os.Remove, os.RemoveAll, os.Stat, require.NoError.

TestSummary

References: assert.Equal, bytes.Buffer, context.Background, filepathext.SmartJoin, os.ReadFile, require.NoError, runtime.GOOS, strings.ReplaceAll.

TestSupportedFileNames

References: fmt.Sprintf, testing.T.

TestTaskDotenv

References: testing.T.

TestTaskDotenvFail

References: testing.T.

TestTaskDotenvOverriddenByEnv

References: testing.T.

TestTaskDotenvParseErrorMessage

References: filepath.Abs, filepath.Join, fmt.Sprintf, require.ErrorContains.

TestTaskDotenvWithVarName

References: testing.T.

TestTaskIgnoreErrors

References: context.Background, io.Discard, require.Error, require.NoError.

TestTaskVersion

References: assert.Equal, io.Discard, require.Error, require.NoError, testing.T.

TestTaskfileWalk

References: assert.Equal, bytes.Buffer, context.Background, require.NoError, testing.T.

TestUserWorkingDirectory

References: assert.Equal, bytes.Buffer, context.Background, fmt.Sprintf, os.Getwd, require.NoError.

TestUserWorkingDirectoryWithIncluded

References: assert.Equal, bytes.Buffer, context.Background, filepathext.SmartJoin, fmt.Sprintf, os.Getwd, require.NoError.

TestVarInheritance

References: cmp.Or, experiments.EnvPrecedence, fmt.Sprintf.

TestVars

TestWhenDirAttributeAndDirExistsItRunsInThatDir

References: assert.Equal, bytes.Buffer, context.Background, filepath.Base, require.NoError, strings.TrimSuffix.

TestWhenDirAttributeItCreatesMissingAndRunsInThatDir

References: assert.Equal, bytes.Buffer, context.Background, filepath.Base, os.RemoveAll, os.Stat, require.NoError, strings.TrimSuffix.

TestWhenNoDirAttributeItRunsInSameDirAsTaskfile

References: assert.Equal, bytes.Buffer, context.Background, filepath.Base, require.NoError, strings.TrimSuffix.

TestWildcard

References: assert.Equal, bytes.Buffer, context.Background, require.Error, require.NoError, testing.T.