File tree Expand file tree Collapse file tree 8 files changed +101
-593
lines changed
Expand file tree Collapse file tree 8 files changed +101
-593
lines changed Original file line number Diff line number Diff line change 3030 name : Lint
3131 runs-on : ubuntu-latest
3232 steps :
33- - uses : actions/checkout@v3
33+ - uses : actions/checkout@v4
3434
35- - uses : actions/setup-go@v3
35+ - uses : actions/setup-go@v5
3636 with :
3737 cache : true
3838 go-version-file : " go.mod"
4444 name : Build
4545 runs-on : ubuntu-latest
4646 steps :
47- - uses : actions/checkout@v3
47+ - uses : actions/checkout@v4
4848
4949 - name : Run build
5050 run : make build
Original file line number Diff line number Diff line change 11linters :
22 disable-all : true
33 enable :
4- - deadcode
54 - goconst
65 - gofmt
76 - revive
@@ -10,23 +9,18 @@ linters:
109 - misspell
1110 - staticcheck
1211 - unconvert
13- - varcheck
14- - vet
15- - vetshadow
1612 - errcheck
1713 - govet
18- - structcheck
1914 - typecheck
2015 - gocritic
16+ - unused
17+ - gci
2118
2219run :
2320
2421 # timeout for analysis
2522 timeout : 5m
2623
27- skip-dirs :
28- - hack
29-
3024linters-settings :
3125 revive :
3226 rules :
@@ -39,8 +33,19 @@ linters-settings:
3933 disabled-checks :
4034 - commentFormatting # we dont want to enforce space before the comment text
4135
42- issues :
36+ gci :
37+ sections :
38+ - standard
39+ - prefix(github.com/v3io/sidecar-proxy)
40+ - default
41+ - blank
42+ - dot
4343
44+ custom-order : true
45+
46+ issues :
47+ exclude-dirs :
48+ - hack
4449 # List of regexps of issue texts to exclude
4550 exclude :
4651 - " comment on"
@@ -52,3 +57,4 @@ issues:
5257 - path : _test\.go
5358 linters :
5459 - goconst
60+ version : 2
Original file line number Diff line number Diff line change 11LABEL ?= unstable
22REPOSITORY ?= gcr.io/iguazio
33IMAGE = $(REPOSITORY ) /sidecar-proxy:$(LABEL )
4+ GOPATH ?= $(shell go env GOPATH)
45
56.PHONY : build
67build :
@@ -13,15 +14,44 @@ build:
1314push :
1415 docker push $(IMAGE )
1516
16- .PHONY : lint
17- lint :
18- ./hack/lint/install.sh
19- ./hack/lint/run.sh
20-
21- .PHONY : fmt
22- fmt :
23- @go fmt $(shell go list ./... | grep -v /vendor/)
24-
2517.PHONY : test
2618test :
2719 go test -p1 -v ./pkg/...
20+
21+ GOLANGCI_LINT_VERSION := v1.64.6
22+ GOLANGCI_LINT_BIN := $(GOPATH ) /bin/golangci-lint
23+ GOLANGCI_LINT_INSTALL_COMMAND := GOBIN=$(GOPATH ) /bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION )
24+
25+ .PHONY : ensure-golangci-linter
26+ ensure-golangci-linter :
27+ @if ! command -v $(GOLANGCI_LINT_BIN ) > /dev/null 2>&1 ; then \
28+ echo " golangci-lint not found. Installing..." ; \
29+ $(GOLANGCI_LINT_INSTALL_COMMAND ) ; \
30+ else \
31+ installed_version=$$($(GOLANGCI_LINT_BIN ) version | awk '/version/ {print $$4}') ; \
32+ if [ " $$ installed_version" != " $( GOLANGCI_LINT_VERSION) " ]; then \
33+ echo " golangci-lint version mismatch ($$ installed_version != $( GOLANGCI_LINT_VERSION) ). Reinstalling..." ; \
34+ $(GOLANGCI_LINT_INSTALL_COMMAND ) ; \
35+ fi \
36+ fi
37+
38+ .PHONY : ensure-gopath
39+ ensure-gopath :
40+ ifndef GOPATH
41+ $(error GOPATH must be set)
42+ endif
43+
44+ .PHONY : modules
45+ modules : ensure-gopath
46+ @go mod download
47+
48+ .PHONY : fmt
49+ fmt : ensure-golangci-linter
50+ gofmt -s -w .
51+ $(GOPATH ) /bin/golangci-lint run --fix
52+
53+ .PHONY : lint
54+ lint : modules ensure-golangci-linter
55+ @echo Linting...
56+ $(GOPATH ) /bin/golangci-lint run -v
57+ @echo Done.
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414#
15- FROM gcr.io/iguazio/golang:1.19 as builder
15+ FROM gcr.io/iguazio/golang:1.23 as builder
1616
1717# copy source tree
1818WORKDIR /sidecar-proxy
Original file line number Diff line number Diff line change 11module github.com/v3io/sidecar-proxy
22
3- go 1.19
3+ go 1.23
44
55require (
66 github.com/nuclio/errors v0.0.4
77 github.com/nuclio/logger v0.0.1
88 github.com/nuclio/loggerus v0.0.6
9- github.com/prometheus/client_golang v1.14 .0
10- github.com/sirupsen/logrus v1.9.0
9+ github.com/prometheus/client_golang v1.22 .0
10+ github.com/sirupsen/logrus v1.9.3
1111)
1212
1313require (
1414 github.com/beorn7/perks v1.0.1 // indirect
15- github.com/cespare/xxhash/v2 v2.1.2 // indirect
16- github.com/golang/protobuf v1.5.2 // indirect
15+ github.com/cespare/xxhash/v2 v2.3.0 // indirect
1716 github.com/logrusorgru/aurora/v3 v3.0.0 // indirect
18- github.com/matttproud/golang_protobuf_extensions v1 .0.1 // indirect
19- github.com/prometheus/client_model v0.3.0 // indirect
20- github.com/prometheus/common v0.37 .0 // indirect
21- github.com/prometheus/procfs v0.8.0 // indirect
22- golang.org/x/sys v0.4 .0 // indirect
23- google.golang.org/protobuf v1.33.0 // indirect
17+ github.com/munnerz/goautoneg v0 .0.0-20191010083416-a7dc8b61c822 // indirect
18+ github.com/prometheus/client_model v0.6.1 // indirect
19+ github.com/prometheus/common v0.62 .0 // indirect
20+ github.com/prometheus/procfs v0.15.1 // indirect
21+ golang.org/x/sys v0.30 .0 // indirect
22+ google.golang.org/protobuf v1.36.6 // indirect
2423)
You can’t perform that action at this time.
0 commit comments