Skip to content

Commit fe2da74

Browse files
fix: don't suggest internal tasks (#2323)
Co-authored-by: Max Mizikar <[email protected]>
1 parent 64fb668 commit fe2da74

File tree

5 files changed

+19
-0
lines changed

5 files changed

+19
-0
lines changed

executor_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,15 @@ func TestFuzzyModel(t *testing.T) {
957957
),
958958
WithTask("install"),
959959
)
960+
961+
NewExecutorTest(t,
962+
WithName("intern"),
963+
WithExecutorOptions(
964+
task.WithDir("testdata/fuzzy"),
965+
),
966+
WithTask("intern"),
967+
WithRunError(),
968+
)
960969
}
961970

962971
func TestIncludeChecksum(t *testing.T) {

setup.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ func (e *Executor) setupFuzzyModel() {
104104

105105
var words []string
106106
for name, task := range e.Taskfile.Tasks.All(nil) {
107+
if task.Internal {
108+
continue
109+
}
107110
words = append(words, name)
108111
words = slices.Concat(words, task.Aliases)
109112
}

testdata/fuzzy/Taskfile.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@ version: 3
22

33
tasks:
44
install: echo 'install'
5+
6+
internal:
7+
internal: true
8+
cmds:
9+
- echo "internal"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
task: Task "intern" does not exist
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
task: No tasks with description available. Try --list-all to list all tasks

0 commit comments

Comments
 (0)