You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support for excluding entire namespaces in addition to individual tasks #2300
Currently, the excludes feature in Task only allows excluding individual tasks by their full names (e.g., "flight-recorder:start", "flight-recorder:dump"). This becomes cumbersome when you want to exclude all tasks within a specific namespace.
Current Behavior
version: "3"includes:
common:
taskfile: ../common/Taskfile.ymlexcludes:
- "flight-recorder:start"
- "flight-recorder:dump"# Need to list each task individually
Desired Behavior
Allow excluding entire namespaces to simplify the configuration:
version: "3"includes:
common:
taskfile: ../common/Taskfile.ymlexcludes:
- "flight-recorder"# Excludes all tasks in flight-recorder namespace
Use Case
When including a large taskfile with multiple namespaces, it's common to want to exclude entire groups of related tasks rather than listing each one individually.
This is especially useful for:
Excluding debugging/monitoring tools (like flight-recorder) from production services
Excluding development-only tasks from deployment pipelines
Excluding test suites that aren't relevant for certain contexts
@dgroh it could be an idea to support regular expressions in the excludes list. Something like this:
func MatchTextAuto(input, pattern string) bool {
// Characters that indicate a likely regex pattern
regexMetaChars := `*+?^$()[]{}|`
// If the pattern contains any meta-characters, treat it as regex
if strings.ContainsAny(pattern, regexMetaChars) {
re, err := regexp.Compile(pattern)
if err == nil {
return re.MatchString(input)
}
}
// Fallback to string matching.
return strings.Contains(input, pattern)
}
@dgroh it could be an idea to support regular expressions in the excludes list. Something like this:
func MatchTextAuto(input, pattern string) bool {
// Characters that indicate a likely regex pattern
regexMetaChars := `*+?^$()[]{}|`
// If the pattern contains any meta-characters, treat it as regex
if strings.ContainsAny(pattern, regexMetaChars) {
re, err := regexp.Compile(pattern)
if err == nil {
return re.MatchString(input)
}
}
// Fallback to string matching.
return strings.Contains(input, pattern)
}
I found it support wildcard task names like deploy:*. If there are tasks like deploy:* and deploy:1 in a included task file, and excludes option like this deploy:*. What's the result it should be, excludes all task matched with regex deploy:* or only excludes task deploy:*.
Activity
trulede commentedon May 31, 2026
@dgroh it could be an idea to support regular expressions in the
excludeslist. Something like this:kjasn commentedon Jul 1, 2026
I found it support wildcard task names like
deploy:*. If there are tasks likedeploy:*anddeploy:1in a included task file, andexcludesoption like thisdeploy:*. What's the result it should be, excludes all task matched with regexdeploy:*or only excludes taskdeploy:*.