Skip to content

Commit 8da592a

Browse files
committed
Merge branch 'main' into bq/refactor-rename-feature
2 parents 4ce0baf + b412ef0 commit 8da592a

File tree

147 files changed

+2599
-1894
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+2599
-1894
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ jobs:
506506
507507
- uses: actions/setup-node@v3
508508
with:
509-
node-version: "14"
509+
node-version: "16.16.0"
510510

511511
- name: Install node_modules
512512
run: ./scripts/yarn_install.sh
@@ -555,7 +555,7 @@ jobs:
555555

556556
- uses: actions/setup-node@v3
557557
with:
558-
node-version: "14"
558+
node-version: "16.16.0"
559559

560560
- name: Echo Go Cache Paths
561561
id: go-cache-paths
@@ -609,6 +609,10 @@ jobs:
609609
# only get 1 commit on shallow checkout.
610610
fetch-depth: 0
611611

612+
- uses: actions/setup-node@v3
613+
with:
614+
node-version: "16.16.0"
615+
612616
- name: Install dependencies
613617
run: cd site && yarn
614618

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,15 @@ install: build/coder_$(VERSION)_$(GOOS)_$(GOARCH)$(GOOS_BIN_EXT)
368368
cp "$<" "$$output_file"
369369
.PHONY: install
370370

371-
fmt: fmt/prettier fmt/terraform fmt/shfmt
371+
fmt: fmt/prettier fmt/terraform fmt/shfmt fmt/go
372372
.PHONY: fmt
373373

374+
fmt/go:
375+
# VS Code users should check out
376+
# https://github.com/mvdan/gofumpt#visual-studio-code
377+
go run mvdan.cc/gofumpt@v0.4.0 -w -l .
378+
.PHONY: fmt/go
379+
374380
fmt/prettier:
375381
echo "--- prettier"
376382
cd site

agent/ssh.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (h *forwardedUnixHandler) HandleSSHRequest(ctx ssh.Context, _ *ssh.Server,
7070

7171
// Create socket parent dir if not exists.
7272
parentDir := filepath.Dir(addr)
73-
err = os.MkdirAll(parentDir, 0700)
73+
err = os.MkdirAll(parentDir, 0o700)
7474
if err != nil {
7575
h.log.Warn(ctx, "create parent dir for SSH unix forward request",
7676
slog.F("parent_dir", parentDir),

cli/clitest/clitest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func extractTar(t *testing.T, data []byte, directory string) {
7878
path := filepath.Join(directory, header.Name)
7979
mode := header.FileInfo().Mode()
8080
if mode == 0 {
81-
mode = 0600
81+
mode = 0o600
8282
}
8383
switch header.Typeflag {
8484
case tar.TypeDir:

cli/config/file.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (f File) Delete() error {
6060

6161
// Write writes the string to the file.
6262
func (f File) Write(s string) error {
63-
return write(string(f), 0600, []byte(s))
63+
return write(string(f), 0o600, []byte(s))
6464
}
6565

6666
// Read reads the file to a string.
@@ -72,7 +72,7 @@ func (f File) Read() (string, error) {
7272
// open opens a file in the configuration directory,
7373
// creating all intermediate directories.
7474
func open(path string, flag int, mode os.FileMode) (*os.File, error) {
75-
err := os.MkdirAll(filepath.Dir(path), 0750)
75+
err := os.MkdirAll(filepath.Dir(path), 0o750)
7676
if err != nil {
7777
return nil, err
7878
}

cli/create_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,8 @@ func TestCreateWithRichParameters(t *testing.T) {
351351
},
352352
},
353353
},
354-
}},
354+
},
355+
},
355356
ProvisionApply: []*proto.Provision_Response{{
356357
Type: &proto.Provision_Response_Complete{
357358
Complete: &proto.Provision_Complete{},
@@ -475,7 +476,8 @@ func TestCreateValidateRichParameters(t *testing.T) {
475476
Parameters: richParameters,
476477
},
477478
},
478-
}},
479+
},
480+
},
479481
ProvisionApply: []*proto.Provision_Response{
480482
{
481483
Type: &proto.Provision_Response_Complete{

cli/dotfiles.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func dotfiles() *cobra.Command {
111111
}
112112

113113
// ensure command dir exists
114-
err = os.MkdirAll(gitCmdDir, 0750)
114+
err = os.MkdirAll(gitCmdDir, 0o750)
115115
if err != nil {
116116
return xerrors.Errorf("ensuring dir at %s: %w", gitCmdDir, err)
117117
}

cli/dotfiles_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestDotfiles(t *testing.T) {
2727
testRepo := testGitRepo(t, root)
2828

2929
// nolint:gosec
30-
err := os.WriteFile(filepath.Join(testRepo, ".bashrc"), []byte("wow"), 0750)
30+
err := os.WriteFile(filepath.Join(testRepo, ".bashrc"), []byte("wow"), 0o750)
3131
require.NoError(t, err)
3232

3333
c := exec.Command("git", "add", ".bashrc")
@@ -56,7 +56,7 @@ func TestDotfiles(t *testing.T) {
5656
testRepo := testGitRepo(t, root)
5757

5858
// nolint:gosec
59-
err := os.WriteFile(filepath.Join(testRepo, "install.sh"), []byte("#!/bin/bash\necho wow > "+filepath.Join(string(root), ".bashrc")), 0750)
59+
err := os.WriteFile(filepath.Join(testRepo, "install.sh"), []byte("#!/bin/bash\necho wow > "+filepath.Join(string(root), ".bashrc")), 0o750)
6060
require.NoError(t, err)
6161

6262
c := exec.Command("git", "add", "install.sh")
@@ -82,12 +82,12 @@ func TestDotfiles(t *testing.T) {
8282
testRepo := testGitRepo(t, root)
8383

8484
// nolint:gosec
85-
err := os.WriteFile(filepath.Join(testRepo, ".bashrc"), []byte("wow"), 0750)
85+
err := os.WriteFile(filepath.Join(testRepo, ".bashrc"), []byte("wow"), 0o750)
8686
require.NoError(t, err)
8787

8888
// add a conflicting file at destination
8989
// nolint:gosec
90-
err = os.WriteFile(filepath.Join(string(root), ".bashrc"), []byte("backup"), 0750)
90+
err = os.WriteFile(filepath.Join(string(root), ".bashrc"), []byte("backup"), 0o750)
9191
require.NoError(t, err)
9292

9393
c := exec.Command("git", "add", ".bashrc")
@@ -119,7 +119,7 @@ func testGitRepo(t *testing.T, root config.Root) string {
119119
r, err := cryptorand.String(8)
120120
require.NoError(t, err)
121121
dir := filepath.Join(string(root), fmt.Sprintf("test-repo-%s", r))
122-
err = os.MkdirAll(dir, 0750)
122+
err = os.MkdirAll(dir, 0o750)
123123
require.NoError(t, err)
124124

125125
c := exec.Command("git", "init")

cli/logout_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func TestLogout(t *testing.T) {
149149
require.NoError(t, err)
150150
} else {
151151
// Changing the permissions to throw error during deletion.
152-
err = os.Chmod(string(config), 0500)
152+
err = os.Chmod(string(config), 0o500)
153153
require.NoError(t, err)
154154
}
155155
defer func() {

cli/parameter.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ func createParameterMapFromFile(parameterFile string) (map[string]string, error)
1818
parameterMap := make(map[string]string)
1919

2020
parameterFileContents, err := os.ReadFile(parameterFile)
21-
2221
if err != nil {
2322
return nil, err
2423
}

0 commit comments

Comments
 (0)