Skip to content

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

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

Merged
merged 3 commits into from
Dec 12, 2023
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
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions coderd/audit/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions coderd/coderdtest/oidctest/idp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions coderd/database/dbmem/dbmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions coderd/metricscache/metricscache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions coderd/oauthpki/okidcpki_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions coderd/util/slice/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion dogfood/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 1 addition & 2 deletions tailnet/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)}})
Expand Down