From c6c69a5a632bac881df6b4b68590d9bcf9d2e32d Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Mon, 8 Apr 2024 21:45:07 -0300 Subject: [PATCH] fix: address compilation error on `watch_test.go` Closes #1567 Co-authored-by: sunpe --- watch.go | 4 ++-- watch_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/watch.go b/watch.go index 8b841293..5ce5f7ee 100644 --- a/watch.go +++ b/watch.go @@ -157,7 +157,7 @@ func (e *Executor) registerWatchedFiles(w *watcher.Watcher, calls ...*ast.Call) if err != nil { return err } - if shouldIgnoreFile(absFile) { + if ShouldIgnoreFile(absFile) { continue } if _, ok := watchedFiles[absFile]; ok { @@ -180,7 +180,7 @@ func (e *Executor) registerWatchedFiles(w *watcher.Watcher, calls ...*ast.Call) return nil } -func shouldIgnoreFile(path string) bool { +func ShouldIgnoreFile(path string) bool { ignorePaths := []string{ "/.task", "/.git", diff --git a/watch_test.go b/watch_test.go index b63af724..f1fb6a21 100644 --- a/watch_test.go +++ b/watch_test.go @@ -58,7 +58,7 @@ Hello, World! case <-ctx.Done(): return default: - err := e.Run(ctx, ast.Task: "default"}) + err := e.Run(ctx, &ast.Call{Task: "default"}) if err != nil { return } @@ -94,7 +94,7 @@ func TestShouldIgnoreFile(t *testing.T) { ct := ct t.Run(fmt.Sprintf("ignore - %d", k), func(t *testing.T) { t.Parallel() - require.Equal(t, shouldIgnoreFile(ct.path), ct.expect) + require.Equal(t, task.ShouldIgnoreFile(ct.path), ct.expect) }) } }