Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"fmt"
"os"
"path/filepath"
"slices"

Check failure on line 8 in setup.go

View workflow job for this annotation

GitHub Actions / Lint (1.24.x)

"slices" imported and not used

Check failure on line 8 in setup.go

View workflow job for this annotation

GitHub Actions / Lint (1.24.x)

"slices" imported and not used

Check failure on line 8 in setup.go

View workflow job for this annotation

GitHub Actions / Lint (1.24.x)

"slices" imported and not used

Check failure on line 8 in setup.go

View workflow job for this annotation

GitHub Actions / Test (1.25.x, ubuntu-latest)

"slices" imported and not used

Check failure on line 8 in setup.go

View workflow job for this annotation

GitHub Actions / Test (1.24.x, ubuntu-latest)

"slices" imported and not used
"strings"
"sync"

"github.com/Masterminds/semver/v3"
"github.com/sajari/fuzzy"

Check failure on line 13 in setup.go

View workflow job for this annotation

GitHub Actions / Lint (1.24.x)

"github.com/sajari/fuzzy" imported and not used (typecheck)

Check failure on line 13 in setup.go

View workflow job for this annotation

GitHub Actions / Lint (1.24.x)

"github.com/sajari/fuzzy" imported and not used) (typecheck)

Check failure on line 13 in setup.go

View workflow job for this annotation

GitHub Actions / Test (1.25.x, ubuntu-latest)

"github.com/sajari/fuzzy" imported and not used

Check failure on line 13 in setup.go

View workflow job for this annotation

GitHub Actions / Test (1.24.x, ubuntu-latest)

"github.com/sajari/fuzzy" imported and not used

"github.com/go-task/task/v3/errors"
"github.com/go-task/task/v3/internal/env"
Expand Down Expand Up @@ -103,24 +103,25 @@
}

func (e *Executor) setupFuzzyModel() {

if e.Taskfile == nil {
return
}

model := fuzzy.NewModel()
model.SetThreshold(1) // because we want to build grammar based on every task name

var words []string
for name, task := range e.Taskfile.Tasks.All(nil) {
if task.Internal {
continue
}
words = append(words, name)
words = slices.Concat(words, task.Aliases)
}

model.Train(words)
e.fuzzyModel = model
//
//model := fuzzy.NewModel()
//model.SetThreshold(1) // because we want to build grammar based on every task name
//
//var words []string
//for name, task := range e.Taskfile.Tasks.All(nil) {
// if task.Internal {
// continue
// }
// words = append(words, name)
// words = slices.Concat(words, task.Aliases)
//}
//
//model.Train(words)
//e.fuzzyModel = model
}

func (e *Executor) setupTempDir() error {
Expand Down
Loading