Skip to content

ci: bump golangci-lint to v1.50.1 #580

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 2 commits into from
Dec 13, 2022
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
9 changes: 3 additions & 6 deletions .github/workflows/static-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ jobs:
with:
go-version: '1.18.3'
- name: Run static checks
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@0ad9a0988b3973e851ab0a07adf248ec2e100376
with:
version: v1.47.0
version: v1.50.1
args: --config=.golangci.yml --verbose
only-new-issues: false
skip-go-installation: true
skip-pkg-cache: true
skip-build-cache: true
skip-cache: true
- name: Check gofmt formatting
run: |
go fmt ./...
Expand Down
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ linters:
- revive
- staticcheck
- unused
- varcheck

issues:
exclude-rules:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.golangci-lint
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/golangci/golangci-lint:v1.49.0
FROM docker.io/golangci/golangci-lint:v1.50.1
RUN apt-get -y update
RUN apt-get -y install libz-dev libelf-dev

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ GO_IMAGE_LDFLAGS="-X 'github.com/cilium/tetragon/pkg/version.Version=$(VERSION)'
GO_OPERATOR_IMAGE_LDFLAGS="-X 'github.com/cilium/tetragon/pkg/version.Version=$(VERSION)' -s -w"


GOLANGCILINT_WANT_VERSION = 1.45.2
GOLANGCILINT_WANT_VERSION = 1.50.1
GOLANGCILINT_VERSION = $(shell golangci-lint version 2>/dev/null)


Expand Down Expand Up @@ -121,7 +121,7 @@ install:
vendor:
$(MAKE) -C ./api vendor
$(MAKE) -C ./pkg/k8s vendor
$(GO) mod tidy -compat=1.17
$(GO) mod tidy -compat=1.18
$(GO) mod vendor
$(GO) mod verify

Expand Down Expand Up @@ -264,7 +264,7 @@ endif

.PHONY: go-format
go-format:
find . -name '*.go' -not -path './vendor/*' -not -path './api/vendor/*' -not -path './pkg/k8s/vendor/*' | xargs gofmt -w
find . -name '*.go' -not -path './vendor/*' -not -path './api/vendor/*' -not -path './pkg/k8s/vendor/*' -not -path './api/v1/tetragon/codegen/*' | xargs gofmt -w

.PHONY: format
format: go-format clang-format
Expand Down
2 changes: 1 addition & 1 deletion api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ v1:

.PHONY: vendor
vendor:
$(GO) mod tidy -compat=1.17
$(GO) mod tidy -compat=1.18
$(GO) mod vendor
$(GO) mod verify
5 changes: 3 additions & 2 deletions cmd/tetragon/addr.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import (
// with net.Listen.
//
// addresses can be:
// unix://absolute_path for unix sockets
// <host>:<port> for TCP (more specifically, an address that can be passed to net.Listen)
//
// unix://absolute_path for unix sockets
// <host>:<port> for TCP (more specifically, an address that can be passed to net.Listen)
//
// Note that the client (tetra) uses https://github.com/grpc/grpc-go/blob/v1.51.0/clientconn.go#L135
// With the syntax is documented in https://github.com/grpc/grpc/blob/master/doc/naming.md. The
Expand Down
4 changes: 2 additions & 2 deletions pkg/k8s/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GO_LDFLAGS="-X 'github.com/cilium/tetragon/pkg/version.Version=$(VERSION)'"
GO_IMAGE_LDFLAGS="-X 'github.com/cilium/tetragon/pkg/version.Version=$(VERSION)' -linkmode external -extldflags -static"
GO_OPERATOR_IMAGE_LDFLAGS="-X 'github.com/cilium/tetragon/pkg/version.Version=$(VERSION)' -s -w"

GOLANGCILINT_WANT_VERSION = 1.45.2
GOLANGCILINT_WANT_VERSION = 1.50.1
GOLANGCILINT_VERSION = $(shell golangci-lint version 2>/dev/null)

all: generate
Expand All @@ -32,6 +32,6 @@ generate:

.PHONY: vendor
vendor:
$(GO) mod tidy -compat=1.17
$(GO) mod tidy -compat=1.18
$(GO) mod vendor
$(GO) mod verify
6 changes: 3 additions & 3 deletions pkg/unixlisten/unixlisten.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
// ListenWithRename creates a "unix" listener for the given path and the given mode
//
// Go's net.Listen() performs three system calls at once:
// - socket, where the file descriptor is created
// - bind, where the unix socket file is created
// - listen, where the socket can now accept connections
// - socket, where the file descriptor is created
// - bind, where the unix socket file is created
// - listen, where the socket can now accept connections
//
// Hence, doing a chmod(2) after Listen is racy because a client can connect
// between the listen(2) and the chmod(2) calls. One solution would be to use
Expand Down