Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6ba92ef

Browse files
authored
ci: enable gocognit (#9359)
And, bring the server under 300:* Removed the undocumented "disable" STUN address in favor of the--disable-direct flag.
1 parent173aac9 commit6ba92ef

File tree

14 files changed

+264
-273
lines changed

14 files changed

+264
-273
lines changed

‎.golangci.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ linters-settings:
1111
# Gradually extend to cover more of the codebase.
1212
-'httpmw\.\w+'
1313
gocognit:
14-
min-complexity:46# Min code complexity (def 30).
14+
min-complexity:300
1515

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

125-
gocyclo:
126-
# goal: 30
127-
min-complexity:47
128-
129125
importas:
130126
no-unaliased:true
131127

@@ -236,7 +232,11 @@ linters:
236232
-exportloopref
237233
-forcetypeassert
238234
-gocritic
239-
-gocyclo
235+
# gocyclo is may be useful in the future when we start caring
236+
# about testing complexity, but for the time being we should
237+
# create a good culture around cognitive complexity.
238+
# - gocyclo
239+
-gocognit
240240
-goimports
241241
-gomodguard
242242
-gosec

‎cli/configssh.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ func sshPrepareWorkspaceConfigs(ctx context.Context, client *codersdk.Client) (r
190190
}
191191
}
192192

193-
//nolint:gocyclo
194193
func (r*RootCmd)configSSH()*clibase.Cmd {
195194
var (
196195
sshConfigFilestring

‎cli/root.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,13 @@ func (r *RootCmd) checkWarnings(i *clibase.Invocation, client *codersdk.Client)
831831
returnnil
832832
}
833833

834+
// Verbosef logs a message if verbose mode is enabled.
835+
func (r*RootCmd)Verbosef(inv*clibase.Invocation,fmtStrstring,args...interface{}) {
836+
ifr.verbose {
837+
cliui.Infof(inv.Stdout,fmtStr,args...)
838+
}
839+
}
840+
834841
typeheaderTransportstruct {
835842
transport http.RoundTripper
836843
header http.Header

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp