Skip to content
Merged
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
12 changes: 6 additions & 6 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ linters-settings:
# Gradually extend to cover more of the codebase.
- 'httpmw\.\w+'
gocognit:
min-complexity: 46 # Min code complexity (def 30).
min-complexity: 300

goconst:
min-len: 4 # Min length of string consts (def 3).
Expand Down Expand Up @@ -122,10 +122,6 @@ linters-settings:
goimports:
local-prefixes: coder.com,cdr.dev,go.coder.com,github.com/cdr,github.com/coder

gocyclo:
# goal: 30
min-complexity: 47

importas:
no-unaliased: true

Expand Down Expand Up @@ -236,7 +232,11 @@ linters:
- exportloopref
- forcetypeassert
- gocritic
- gocyclo
# gocyclo is may be useful in the future when we start caring
# about testing complexity, but for the time being we should
# create a good culture around cognitive complexity.
# - gocyclo
- gocognit
- goimports
- gomodguard
- gosec
Expand Down
1 change: 0 additions & 1 deletion cli/configssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ func sshPrepareWorkspaceConfigs(ctx context.Context, client *codersdk.Client) (r
}
}

//nolint:gocyclo
func (r *RootCmd) configSSH() *clibase.Cmd {
var (
sshConfigFile string
Expand Down
7 changes: 7 additions & 0 deletions cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,13 @@ func (r *RootCmd) checkWarnings(i *clibase.Invocation, client *codersdk.Client)
return nil
}

// Verbosef logs a message if verbose mode is enabled.
func (r *RootCmd) Verbosef(inv *clibase.Invocation, fmtStr string, args ...interface{}) {
if r.verbose {
cliui.Infof(inv.Stdout, fmtStr, args...)
}
}

type headerTransport struct {
transport http.RoundTripper
header http.Header
Expand Down
Loading