Skip to content

Commit 804c52f

Browse files
committed
chore(lint): add local golangci-lint and suppress deprecation warnings
1 parent 434f4b4 commit 804c52f

File tree

4 files changed

+104
-4
lines changed

4 files changed

+104
-4
lines changed

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ else
1111
VERSION_TAG=$(VERSION)
1212
endif
1313

14+
## Location to install dependencies to
15+
LOCALBIN ?= $(shell pwd)/.bin
16+
17+
## Tool Binaries
18+
GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint
19+
20+
## Tool Versions
21+
GOLANGCI_LINT_VERSION ?= v2.8.0
22+
1423
# Image URL to use all building/pushing image targets
1524
IMG_F ?= docker.io/flanksource/canary-checker-full:${VERSION_TAG}
1625
IMG ?= docker.io/flanksource/canary-checker:${VERSION_TAG}
@@ -160,8 +169,13 @@ release: binaries
160169
kustomize build config/ > .release/release.yaml
161170

162171
.PHONY: lint
163-
lint: gen-schemas
164-
golangci-lint run -v ./...
172+
lint: $(GOLANGCI_LINT)
173+
$(GOLANGCI_LINT) run -v ./...
174+
175+
.PHONY: golangci-lint
176+
golangci-lint: $(GOLANGCI_LINT)
177+
$(GOLANGCI_LINT): $(LOCALBIN)
178+
test -s $(LOCALBIN)/golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(LOCALBIN) $(GOLANGCI_LINT_VERSION)
165179

166180
.PHONY: build-api-docs
167181
build-api-docs:

checks/database_backup_gcp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func newSQLAdmin(ctx dutyContext.Context, conn *connection.GCPConnection) (*sqla
142142
return nil, err
143143
}
144144

145-
client, err := sqladmin.NewService(ctx.Context, option.WithEndpoint(conn.Endpoint), option.WithCredentialsJSON([]byte(credential)))
145+
client, err := sqladmin.NewService(ctx.Context, option.WithEndpoint(conn.Endpoint), option.WithCredentialsJSON([]byte(credential))) //nolint:staticcheck
146146
if err != nil {
147147
return nil, err
148148
}

config/deploy/manifests.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7402,6 +7402,49 @@ spec:
74027402
template:
74037403
type: string
74047404
type: object
7405+
headers:
7406+
items:
7407+
properties:
7408+
name:
7409+
type: string
7410+
value:
7411+
type: string
7412+
valueFrom:
7413+
properties:
7414+
configMapKeyRef:
7415+
properties:
7416+
key:
7417+
type: string
7418+
name:
7419+
type: string
7420+
required:
7421+
- key
7422+
type: object
7423+
helmRef:
7424+
properties:
7425+
key:
7426+
description: Key is a JSONPath expression used to fetch the key from the merged JSON.
7427+
type: string
7428+
name:
7429+
type: string
7430+
required:
7431+
- key
7432+
type: object
7433+
secretKeyRef:
7434+
properties:
7435+
key:
7436+
type: string
7437+
name:
7438+
type: string
7439+
required:
7440+
- key
7441+
type: object
7442+
serviceAccount:
7443+
description: ServiceAccount specifies the service account whose token should be fetched
7444+
type: string
7445+
type: object
7446+
type: object
7447+
type: array
74057448
host:
74067449
description: 'Deprecated: use `url` instead'
74077450
type: string
@@ -10851,6 +10894,49 @@ spec:
1085110894
type: string
1085210895
digest:
1085310896
type: boolean
10897+
headers:
10898+
items:
10899+
properties:
10900+
name:
10901+
type: string
10902+
value:
10903+
type: string
10904+
valueFrom:
10905+
properties:
10906+
configMapKeyRef:
10907+
properties:
10908+
key:
10909+
type: string
10910+
name:
10911+
type: string
10912+
required:
10913+
- key
10914+
type: object
10915+
helmRef:
10916+
properties:
10917+
key:
10918+
description: Key is a JSONPath expression used to fetch the key from the merged JSON.
10919+
type: string
10920+
name:
10921+
type: string
10922+
required:
10923+
- key
10924+
type: object
10925+
secretKeyRef:
10926+
properties:
10927+
key:
10928+
type: string
10929+
name:
10930+
type: string
10931+
required:
10932+
- key
10933+
type: object
10934+
serviceAccount:
10935+
description: ServiceAccount specifies the service account whose token should be fetched
10936+
type: string
10937+
type: object
10938+
type: object
10939+
type: array
1085410940
ntlm:
1085510941
type: boolean
1085610942
ntlmv2:

pkg/echo/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func New(ctx context.Context) *echo.Echo {
4545
echoLogConfig := middleware.DefaultLoggerConfig
4646
echoLogConfig.Skipper = telemetryURLSkipper
4747

48-
e.Use(middleware.LoggerWithConfig(echoLogConfig))
48+
e.Use(middleware.LoggerWithConfig(echoLogConfig)) //nolint:staticcheck
4949

5050
e.Use(func(next echo.HandlerFunc) echo.HandlerFunc {
5151
return func(c echo.Context) error {

0 commit comments

Comments
 (0)