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 |
|
No comment on field. |
| Vars |
|
No comment on field. |
| Silent |
|
No comment on field. |
| Indirect |
|
No comment on field. |
Compiler
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| Dir |
|
No comment on field. |
| Entrypoint |
|
No comment on field. |
| UserWorkingDir |
|
No comment on field. |
| TaskfileEnv |
|
No comment on field. |
| TaskfileVars |
|
No comment on field. |
| Logger |
|
No comment on field. |
| dynamicCache |
|
No comment on field. |
| muDynamicCache |
|
No comment on field. |
FilterFunc
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| type |
|
No comment on field. |
ListOptions
ListOptions collects list-related options
| Field name | Field type | Comment |
|---|---|---|
| ListOnlyTasksWithDescriptions |
|
No comment on field. |
| ListAllTasks |
|
No comment on field. |
| FormatTaskListAsJSON |
|
No comment on field. |
| NoStatus |
|
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 |
|
No comment on field. |
| Wildcards |
|
No comment on field. |
ExecutorOption, Executor, TempDir
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| type |
|
No comment on field. |
| Dir |
|
Flags |
| Entrypoint |
|
No comment on field. |
| TempDir |
|
No comment on field. |
| Force |
|
No comment on field. |
| ForceAll |
|
No comment on field. |
| Insecure |
|
No comment on field. |
| Download |
|
No comment on field. |
| Offline |
|
No comment on field. |
| Timeout |
|
No comment on field. |
| CacheExpiryDuration |
|
No comment on field. |
| Watch |
|
No comment on field. |
| Verbose |
|
No comment on field. |
| Silent |
|
No comment on field. |
| AssumeYes |
|
No comment on field. |
| AssumeTerm |
|
No comment on field. |
| Dry |
|
No comment on field. |
| Summary |
|
No comment on field. |
| Parallel |
|
No comment on field. |
| Color |
|
No comment on field. |
| Concurrency |
|
No comment on field. |
| Interval |
|
No comment on field. |
| Stdin |
|
I/O |
| Stdout |
|
No comment on field. |
| Stderr |
|
No comment on field. |
| Taskfile |
|
Internal |
| Logger |
|
No comment on field. |
| Compiler |
|
No comment on field. |
| Output |
|
No comment on field. |
| OutputStyle |
|
No comment on field. |
| TaskSorter |
|
No comment on field. |
| UserWorkingDir |
|
No comment on field. |
| EnableVersionCheck |
|
No comment on field. |
| fuzzyModel |
|
No comment on field. |
| concurrencySemaphore |
|
No comment on field. |
| taskCallCount |
|
No comment on field. |
| mkdirMutexMap |
|
No comment on field. |
| executionHashes |
|
No comment on field. |
| executionHashesMutex |
|
No comment on field. |
| watchedDirs |
|
No comment on field. |
| Remote |
|
No comment on field. |
| Fingerprint |
|
No comment on field. |
assumeTermOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| assumeTerm |
|
No comment on field. |
assumeYesOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| assumeYes |
|
No comment on field. |
cacheExpiryDurationOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| duration |
|
No comment on field. |
colorOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| color |
|
No comment on field. |
concurrencyOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| concurrency |
|
No comment on field. |
dirOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| dir |
|
No comment on field. |
downloadOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| download |
|
No comment on field. |
dryOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| dry |
|
No comment on field. |
entrypointOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| entrypoint |
|
No comment on field. |
forceAllOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| forceAll |
|
No comment on field. |
forceOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| force |
|
No comment on field. |
insecureOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| insecure |
|
No comment on field. |
intervalOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| interval |
|
No comment on field. |
ioOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| rw |
|
No comment on field. |
offlineOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| offline |
|
No comment on field. |
outputStyleOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| outputStyle |
|
No comment on field. |
parallelOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| parallel |
|
No comment on field. |
silentOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| silent |
|
No comment on field. |
stderrOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| stderr |
|
No comment on field. |
stdinOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| stdin |
|
No comment on field. |
stdoutOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| stdout |
|
No comment on field. |
summaryOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| summary |
|
No comment on field. |
taskSorterOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| sorter |
|
No comment on field. |
tempDirOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| tempDir |
|
No comment on field. |
timeoutOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| timeout |
|
No comment on field. |
traverseFunc
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| type |
|
No comment on field. |
verboseOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| verbose |
|
No comment on field. |
versionCheckOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| enableVersionCheck |
|
No comment on field. |
watchOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| watch |
|
No comment on field. |
Functions
func Completion
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
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
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
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
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
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
func emptyFunc
func isContextError
func itemsFromFor
func product
product generates the cartesian product of the input map of slices.
References: maps.Copy.func resolveMatrixRefs
func shouldRunOnCurrentPlatform
func getSpecialVars
func getVariables
func acquireConcurrencyLimit
func areTaskPreconditionsMet
func areTaskRequiredVarsAllowedValuesSet
func areTaskRequiredVarsSet
func collectSources
func compiledTask
func doVersionChecks
func getRootNode
func mkdir
func readDotEnvFiles
func readTaskfile
func registerWatchedDirs
func releaseConcurrencyLimit
func runCommand
func runDeferred
func runDeps
func setupCompiler
func setupConcurrencyState
func setupDefaults
func setupFuzzyModel
func setupLogger
func setupOutput
func setupStdFiles
func setupTempDir
func splitRegularAndWatchCalls
func startExecution
func statusOnError
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 |
|
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 |
|
No comment on field. |
| mu |
|
No comment on field. |
TestOption, TaskTest
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| type |
|
No comment on field. |
| name |
|
No comment on field. |
| experiments |
|
No comment on field. |
| postProcessFns |
|
No comment on field. |
| fixtureTemplateData |
|
No comment on field. |
ExecutorTestOption, ExecutorTest
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| type |
|
No comment on field. |
|
No comment on field. | |
| task |
|
No comment on field. |
| vars |
|
No comment on field. |
| input |
|
No comment on field. |
| executorOpts |
|
No comment on field. |
| wantSetupError |
|
No comment on field. |
| wantRunError |
|
No comment on field. |
| wantStatusError |
|
No comment on field. |
FormatterTestOption, FormatterTest
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| type |
|
No comment on field. |
|
No comment on field. | |
| task |
|
No comment on field. |
| vars |
|
No comment on field. |
| executorOpts |
|
No comment on field. |
| listOptions |
|
No comment on field. |
| wantSetupError |
|
No comment on field. |
| wantListError |
|
No comment on field. |
executorOptionsTestOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| executorOpts |
|
No comment on field. |
experimentTestOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| experiment |
|
No comment on field. |
| value |
|
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 |
|
No comment on field. |
| Entrypoint |
|
No comment on field. |
| Target |
|
No comment on field. |
| TrimSpace |
|
No comment on field. |
| Files |
|
No comment on field. |
fixtureTemplateDataTestOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| data |
|
No comment on field. |
inputTestOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| input |
|
No comment on field. |
listErrorTestOption
This type doesn't have documentation.
listOptionsTestOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| listOptions |
|
No comment on field. |
nameTestOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| name |
|
No comment on field. |
postProcessFnTestOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| fn |
|
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 |
|
No comment on field. |
varTestOption
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| key |
|
No comment on field. |
| value |
|
No comment on field. |