Skip to content

Commit 91ea40a

Browse files
committed
Fix linting errors
1 parent cbbae07 commit 91ea40a

10 files changed

+29
-18
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"protobuf",
5353
"provisionerd",
5454
"provisionersdk",
55+
"ptty",
5556
"ptytest",
5657
"retrier",
5758
"sdkproto",

cli/login_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package cli_test
33
import (
44
"testing"
55

6+
"github.com/stretchr/testify/require"
7+
68
"github.com/coder/coder/cli/clitest"
79
"github.com/coder/coder/coderd/coderdtest"
810
"github.com/coder/coder/pty/ptytest"
9-
"github.com/stretchr/testify/require"
1011
)
1112

1213
func TestLogin(t *testing.T) {

cli/workspacecreate_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package cli_test
33
import (
44
"testing"
55

6+
"github.com/stretchr/testify/require"
7+
68
"github.com/coder/coder/cli/clitest"
79
"github.com/coder/coder/coderd/coderdtest"
810
"github.com/coder/coder/provisioner/echo"
911
"github.com/coder/coder/provisionersdk/proto"
1012
"github.com/coder/coder/pty/ptytest"
11-
"github.com/stretchr/testify/require"
1213
)
1314

1415
func TestWorkspaceCreate(t *testing.T) {

coderd/projectimport_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import (
55
"net/http"
66
"testing"
77

8+
"github.com/stretchr/testify/require"
9+
810
"github.com/coder/coder/coderd"
911
"github.com/coder/coder/coderd/coderdtest"
1012
"github.com/coder/coder/codersdk"
1113
"github.com/coder/coder/database"
1214
"github.com/coder/coder/provisioner/echo"
1315
"github.com/coder/coder/provisionersdk/proto"
14-
"github.com/stretchr/testify/require"
1516
)
1617

1718
func TestPostProjectImportByOrganization(t *testing.T) {

codersdk/projectimport_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ import (
55
"testing"
66
"time"
77

8+
"github.com/google/uuid"
9+
"github.com/stretchr/testify/require"
10+
811
"github.com/coder/coder/coderd"
912
"github.com/coder/coder/coderd/coderdtest"
1013
"github.com/coder/coder/provisioner/echo"
1114
"github.com/coder/coder/provisionersdk/proto"
12-
"github.com/google/uuid"
13-
"github.com/stretchr/testify/require"
1415
)
1516

1617
func TestCreateProjectImportJob(t *testing.T) {

pty/ptytest/ptytest.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ import (
1111
"testing"
1212
"unicode/utf8"
1313

14-
"github.com/coder/coder/pty"
1514
"github.com/stretchr/testify/require"
15+
16+
"github.com/coder/coder/pty"
1617
)
1718

1819
var (
@@ -22,18 +23,18 @@ var (
2223
)
2324

2425
func New(t *testing.T) *PTY {
25-
pty, err := pty.New()
26+
ptty, err := pty.New()
2627
require.NoError(t, err)
27-
return create(t, pty)
28+
return create(t, ptty)
2829
}
2930

3031
func Start(t *testing.T, cmd *exec.Cmd) *PTY {
31-
pty, err := pty.Start(cmd)
32+
ptty, err := pty.Start(cmd)
3233
require.NoError(t, err)
33-
return create(t, pty)
34+
return create(t, ptty)
3435
}
3536

36-
func create(t *testing.T, pty pty.PTY) *PTY {
37+
func create(t *testing.T, ptty pty.PTY) *PTY {
3738
reader, writer := io.Pipe()
3839
scanner := bufio.NewScanner(reader)
3940
t.Cleanup(func() {
@@ -50,14 +51,14 @@ func create(t *testing.T, pty pty.PTY) *PTY {
5051
}()
5152

5253
t.Cleanup(func() {
53-
_ = pty.Close()
54+
_ = ptty.Close()
5455
})
5556
return &PTY{
5657
t: t,
57-
PTY: pty,
58+
PTY: ptty,
5859

5960
outputWriter: writer,
60-
runeReader: bufio.NewReaderSize(pty.Output(), utf8.UTFMax),
61+
runeReader: bufio.NewReaderSize(ptty.Output(), utf8.UTFMax),
6162
}
6263
}
6364

pty/ptytest/ptytest_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
)
88

99
func TestPtytest(t *testing.T) {
10+
t.Parallel()
1011
pty := ptytest.New(t)
1112
pty.Output().Write([]byte("write"))
1213
pty.ExpectMatch("write")

pty/start_other.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
func startPty(cmd *exec.Cmd) (PTY, error) {
14-
pty, tty, err := pty.Open()
14+
ptty, tty, err := pty.Open()
1515
if err != nil {
1616
return nil, err
1717
}
@@ -24,11 +24,11 @@ func startPty(cmd *exec.Cmd) (PTY, error) {
2424
cmd.Stdin = tty
2525
err = cmd.Start()
2626
if err != nil {
27-
_ = pty.Close()
27+
_ = ptty.Close()
2828
return nil, err
2929
}
3030
return &otherPty{
31-
pty: pty,
31+
pty: ptty,
3232
tty: tty,
3333
}, nil
3434
}

pty/start_other_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import (
1111
)
1212

1313
func TestStart(t *testing.T) {
14+
t.Parallel()
1415
t.Run("Echo", func(t *testing.T) {
16+
t.Parallel()
1517
pty := ptytest.Start(t, exec.Command("echo", "test"))
1618
pty.ExpectMatch("test")
1719
})

pty/start_windows_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ func TestMain(m *testing.M) {
1515
}
1616

1717
func TestStart(t *testing.T) {
18+
t.Parallel()
1819
t.Run("Echo", func(t *testing.T) {
20+
t.Parallel()
1921
pty := ptytest.Start(t, exec.Command("cmd.exe", "/c", "echo", "test"))
2022
pty.ExpectMatch("test")
2123
})
22-
2324
t.Run("Resize", func(t *testing.T) {
25+
t.Parallel()
2426
pty := ptytest.Start(t, exec.Command("cmd.exe"))
2527
err := pty.Resize(100, 50)
2628
require.NoError(t, err)

0 commit comments

Comments
 (0)