ci: enable gocognit (#9359)

And, bring the server under 300:

* Removed the undocumented "disable" STUN address in favor of the
--disable-direct flag.
This commit is contained in:
Ammar Bandukwala
2023-08-27 14:46:44 -05:00
committed by GitHub
parent 173aac959c
commit 6ba92ef924
14 changed files with 263 additions and 272 deletions
+6 -6
View File
@@ -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).
@@ -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
@@ -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