Merge pull request #2346 from kolyshkin/golangci-lint

ci: fixups to golangci lint configuration
This commit is contained in:
openshift-merge-bot[bot] 2025-03-04 19:31:32 +00:00 committed by GitHub
commit 2d7cb1ca7c
3 changed files with 4 additions and 11 deletions

View File

@ -9,7 +9,6 @@ env:
GOPATH: &gopath "/var/tmp/go" GOPATH: &gopath "/var/tmp/go"
GOBIN: "${GOPATH}/bin" GOBIN: "${GOPATH}/bin"
GOCACHE: "${GOPATH}/cache" GOCACHE: "${GOPATH}/cache"
GOLANGCI_LINT_CACHE: "$GOCACHE"
GOSRC: &gosrc "${GOPATH}/src/github.com/containers/common" GOSRC: &gosrc "${GOPATH}/src/github.com/containers/common"
CIRRUS_WORKING_DIR: *gosrc CIRRUS_WORKING_DIR: *gosrc
# The default is 'sh' if unspecified # The default is 'sh' if unspecified
@ -47,7 +46,6 @@ testing_task:
env: env:
NETAVARK_BINARY: "/usr/libexec/podman/netavark" NETAVARK_BINARY: "/usr/libexec/podman/netavark"
test_script: test_script:
- mkdir "$GOLANGCI_LINT_CACHE"
- export PATH="$PATH:$GOPATH/bin" - export PATH="$PATH:$GOPATH/bin"
- gpg --batch --passphrase '' --quick-gen-key tester@localhost default default never - gpg --batch --passphrase '' --quick-gen-key tester@localhost default default never
- make vendor - make vendor

View File

@ -30,7 +30,6 @@ linters:
- exhaustive - exhaustive
- gochecknoglobals - gochecknoglobals
- err113 - err113
- gomnd
- nolintlint - nolintlint
- wrapcheck - wrapcheck
- varnamelen - varnamelen
@ -46,7 +45,6 @@ linters:
- maintidx - maintidx
- ireturn - ireturn
- exhaustruct - exhaustruct
- execinquery
- gosec - gosec
- godot - godot
- gocyclo - gocyclo

View File

@ -71,8 +71,8 @@ docs:
$(MAKE) -C docs $(MAKE) -C docs
.PHONY: validate .PHONY: validate
validate: build/golangci-lint validate:
./build/golangci-lint run golangci-lint run
./tools/validate_seccomp.sh ./pkg/seccomp ./tools/validate_seccomp.sh ./pkg/seccomp
vendor-in-container: vendor-in-container:
@ -85,12 +85,9 @@ vendor:
$(GO) mod verify $(GO) mod verify
.PHONY: install.tools .PHONY: install.tools
install.tools: build/golangci-lint .install.md2man install.tools: .install.md2man
build/golangci-lint: VERSION=v1.60.3
build/golangci-lint:
curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/$(VERSION)/install.sh | sh -s -- -b ./build $(VERSION)
.PHONY: .install.md2man
.install.md2man: .install.md2man:
$(GO) install github.com/cpuguy83/go-md2man/v2@latest $(GO) install github.com/cpuguy83/go-md2man/v2@latest