Skip to content

chore: update gofumpt from v0.4.0 to v0.8.0 #18652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ fmt/go:
# https://github.com/mvdan/gofumpt#visual-studio-code
find . $(FIND_EXCLUSIONS) -type f -name '*.go' -print0 | \
xargs -0 grep --null -L "DO NOT EDIT" | \
xargs -0 go run mvdan.cc/gofumpt@v0.4.0 -w -l
xargs -0 go run mvdan.cc/gofumpt@v0.8.0 -w -l
.PHONY: fmt/go

fmt/ts: site/node_modules/.installed
Expand Down
2 changes: 1 addition & 1 deletion agent/agentcontainers/dcspec/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fi
exec 3>&-

# Format the generated code.
go run mvdan.cc/gofumpt@v0.4.0 -w -l "${TMPDIR}/${DEST_FILENAME}"
go run mvdan.cc/gofumpt@v0.8.0 -w -l "${TMPDIR}/${DEST_FILENAME}"

# Add a header so that Go recognizes this as a generated file.
if grep -q -- "\[-i extension\]" < <(sed -h 2>&1); then
Expand Down
2 changes: 1 addition & 1 deletion cli/configssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ func (r *RootCmd) configSSH() *serpent.Command {

if !bytes.Equal(configRaw, configModified) {
sshDir := filepath.Dir(sshConfigFile)
if err := os.MkdirAll(sshDir, 0700); err != nil {
if err := os.MkdirAll(sshDir, 0o700); err != nil {
return xerrors.Errorf("failed to create directory %q: %w", sshDir, err)
}

Expand Down
11 changes: 7 additions & 4 deletions cli/configssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,11 @@ func TestConfigSSH_MissingDirectory(t *testing.T) {
_, err = os.Stat(sshConfigPath)
require.NoError(t, err, "config file should exist")

// Check that the directory has proper permissions (0700)
// Check that the directory has proper permissions (rwx for owner, none for
// group and everyone)
sshDirInfo, err := os.Stat(sshDir)
require.NoError(t, err)
require.Equal(t, os.FileMode(0700), sshDirInfo.Mode().Perm(), "directory should have 0700 permissions")
require.Equal(t, os.FileMode(0o700), sshDirInfo.Mode().Perm(), "directory should have rwx------ permissions")
}

func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
Expand Down Expand Up @@ -358,7 +359,8 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
strings.Join([]string{
headerEnd,
"",
}, "\n")},
}, "\n"),
},
},
args: []string{"--ssh-option", "ForwardAgent=yes"},
matches: []match{
Expand All @@ -383,7 +385,8 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
strings.Join([]string{
headerEnd,
"",
}, "\n")},
}, "\n"),
},
},
args: []string{"--ssh-option", "ForwardAgent=yes"},
matches: []match{
Expand Down
1 change: 0 additions & 1 deletion coderd/notifications/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ func (i *dispatchInterceptor) Dispatcher(payload types.MessagePayload, title, bo
}

retryable, err = deliveryFn(ctx, msgID)

if err != nil {
i.err.Add(1)
i.lastErr.Store(err)
Expand Down
Loading