Skip to content

Commit aae4447

Browse files
committed
fix: linting issues
1 parent a8d65fb commit aae4447

File tree

2 files changed

+8
-25
lines changed

2 files changed

+8
-25
lines changed

internal/fsext/fs_test.go

+8
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ import (
99
)
1010

1111
func TestDefaultDir(t *testing.T) {
12+
t.Parallel()
13+
1214
wd, err := os.Getwd()
1315
require.NoError(t, err)
16+
1417
tests := []struct {
1518
name string
1619
entrypoint string
@@ -50,14 +53,18 @@ func TestDefaultDir(t *testing.T) {
5053
}
5154
for _, tt := range tests {
5255
t.Run(tt.name, func(t *testing.T) {
56+
t.Parallel()
5357
require.Equal(t, tt.expected, DefaultDir(tt.entrypoint, tt.dir))
5458
})
5559
}
5660
}
5761

5862
func TestSearch(t *testing.T) {
63+
t.Parallel()
64+
5965
wd, err := os.Getwd()
6066
require.NoError(t, err)
67+
6168
tests := []struct {
6269
name string
6370
entrypoint string
@@ -135,6 +142,7 @@ func TestSearch(t *testing.T) {
135142
}
136143
for _, tt := range tests {
137144
t.Run(tt.name, func(t *testing.T) {
145+
t.Parallel()
138146
entrypoint, dir, err := Search(tt.entrypoint, tt.dir, tt.possibleFilenames)
139147
require.NoError(t, err)
140148
require.Equal(t, tt.expectedEntrypoint, entrypoint)

taskfile/node.go

-25
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package taskfile
22

33
import (
44
"context"
5-
"os"
6-
"path/filepath"
75
"strings"
86
"time"
97

@@ -82,26 +80,3 @@ func getScheme(uri string) (string, error) {
8280
}
8381
return "", nil
8482
}
85-
86-
func getDefaultDir(entrypoint, dir string) string {
87-
// If the entrypoint and dir are empty, we default the directory to the current working directory
88-
if dir == "" {
89-
if entrypoint == "" {
90-
wd, err := os.Getwd()
91-
if err != nil {
92-
return ""
93-
}
94-
dir = wd
95-
}
96-
return dir
97-
}
98-
99-
// If the directory is set, ensure it is an absolute path
100-
var err error
101-
dir, err = filepath.Abs(dir)
102-
if err != nil {
103-
return ""
104-
}
105-
106-
return dir
107-
}

0 commit comments

Comments
 (0)