chore(Makefile): use linter version from dogfood Dockerfile (#11147)

* chore(Makefile): use golangci-lint version from dogfood Dockerfile

* chore(dogfood/Dockerfile): update golangci-lint to latest version

* chore(coderd): address linter complaints
This commit is contained in:
Cian Johnston 2023-12-12 10:02:32 +00:00 committed by GitHub
parent d07fa9c62f
commit 197cd935cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 10 additions and 12 deletions

View File

@ -428,7 +428,8 @@ lint/ts:
lint/go:
./scripts/check_enterprise_imports.sh
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2
linter_ver=$(shell egrep -o 'GOLANGCI_LINT_VERSION=\S+' dogfood/Dockerfile | cut -d '=' -f 2)
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v$$linter_ver
golangci-lint run
.PHONY: lint/go

View File

@ -361,9 +361,8 @@ func either[T Auditable, R any](old, new T, fn func(T) R, auditAction database.A
// If the request action is a login or logout, we always want to audit it even if
// there is no diff. See the comment in audit.InitRequest for more detail.
return fn(old)
} else {
panic("both old and new are nil")
}
panic("both old and new are nil")
}
func parseIP(ipStr string) pqtype.Inet {

View File

@ -987,6 +987,7 @@ func (f fakeRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
return f.roundTrip(req)
}
//nolint:gosec // these are test credentials
const testRSAPrivateKey = `-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDLets8+7M+iAQAqN/5BVyCIjhTQ4cmXulL+gm3v0oGMWzLupUS
v8KPA+Tp7dgC/DZPfMLaNH1obBBhJ9DhS6RdS3AS3kzeFrdu8zFHLWF53DUBhS92

View File

@ -4679,9 +4679,8 @@ func (q *FakeQuerier) InsertAuditLog(_ context.Context, arg database.InsertAudit
return -1
} else if a.Time.Equal(b.Time) {
return 0
} else {
return 1
}
return 1
})
return alog, nil

View File

@ -153,9 +153,8 @@ func convertDAUResponse[T dauRow](rows []T, tzOffset int) codersdk.DAUsResponse
return -1
} else if a.Equal(b) {
return 0
} else {
return 1
}
return 1
})
var resp codersdk.DAUsResponse

View File

@ -25,6 +25,7 @@ import (
"github.com/coder/coder/v2/testutil"
)
//nolint:gosec // these are just for testing
const (
testClientKey = `-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAnUryZEfn5kA8wuk9a7ogFuWbk3uPHEhioYuAg9m3/tIdqSqu

View File

@ -79,9 +79,8 @@ func Ascending[T constraints.Ordered](a, b T) int {
return -1
} else if a == b {
return 0
} else {
return 1
}
return 1
}
func Descending[T constraints.Ordered](a, b T) int {

View File

@ -224,7 +224,7 @@ RUN systemctl enable \
ARG CLOUD_SQL_PROXY_VERSION=2.2.0 \
DIVE_VERSION=0.10.0 \
DOCKER_GCR_VERSION=2.1.8 \
GOLANGCI_LINT_VERSION=1.52.2 \
GOLANGCI_LINT_VERSION=1.55.2 \
GRYPE_VERSION=0.61.1 \
HELM_VERSION=3.12.0 \
KUBE_LINTER_VERSION=0.6.3 \

View File

@ -239,9 +239,8 @@ func ServeMultiAgent(c CoordinatorV2, logger slog.Logger, id uuid.UUID) MultiAge
// legacy IP. Agents with only the legacy IP aren't compatible
// with single_tailnet and must be routed through wsconncache.
return true
} else {
return false
}
return false
},
OnSubscribe: func(enq Queue, agent uuid.UUID) (*Node, error) {
err := SendCtx(ctx, reqs, &proto.CoordinateRequest{AddTunnel: &proto.CoordinateRequest_Tunnel{Uuid: UUIDToByteSlice(agent)}})