mirror of
https://github.com/go-task/task.git
synced 2025-07-15 01:35:00 +02:00
fix: don't suggest internal tasks (#2323)
Co-authored-by: Max Mizikar <maxmzkr@gmail.com>
This commit is contained in:
@ -957,6 +957,15 @@ func TestFuzzyModel(t *testing.T) {
|
|||||||
),
|
),
|
||||||
WithTask("install"),
|
WithTask("install"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
NewExecutorTest(t,
|
||||||
|
WithName("intern"),
|
||||||
|
WithExecutorOptions(
|
||||||
|
task.WithDir("testdata/fuzzy"),
|
||||||
|
),
|
||||||
|
WithTask("intern"),
|
||||||
|
WithRunError(),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestIncludeChecksum(t *testing.T) {
|
func TestIncludeChecksum(t *testing.T) {
|
||||||
|
3
setup.go
3
setup.go
@ -104,6 +104,9 @@ func (e *Executor) setupFuzzyModel() {
|
|||||||
|
|
||||||
var words []string
|
var words []string
|
||||||
for name, task := range e.Taskfile.Tasks.All(nil) {
|
for name, task := range e.Taskfile.Tasks.All(nil) {
|
||||||
|
if task.Internal {
|
||||||
|
continue
|
||||||
|
}
|
||||||
words = append(words, name)
|
words = append(words, name)
|
||||||
words = slices.Concat(words, task.Aliases)
|
words = slices.Concat(words, task.Aliases)
|
||||||
}
|
}
|
||||||
|
5
testdata/fuzzy/Taskfile.yml
vendored
5
testdata/fuzzy/Taskfile.yml
vendored
@ -2,3 +2,8 @@ version: 3
|
|||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
install: echo 'install'
|
install: echo 'install'
|
||||||
|
|
||||||
|
internal:
|
||||||
|
internal: true
|
||||||
|
cmds:
|
||||||
|
- echo "internal"
|
||||||
|
1
testdata/fuzzy/testdata/TestFuzzyModel-intern-err-run.golden
vendored
Normal file
1
testdata/fuzzy/testdata/TestFuzzyModel-intern-err-run.golden
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
task: Task "intern" does not exist
|
1
testdata/fuzzy/testdata/TestFuzzyModel-intern.golden
vendored
Normal file
1
testdata/fuzzy/testdata/TestFuzzyModel-intern.golden
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
task: No tasks with description available. Try --list-all to list all tasks
|
Reference in New Issue
Block a user