ci(lint): create .golangci.yaml (#18410)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL 2024-05-26 00:27:25 +02:00 committed by GitHub
parent d871b7f0c2
commit cd3c478a7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 15 additions and 5 deletions

View file

@ -109,8 +109,8 @@ jobs:
- name: Run golangci-lint
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1
with:
version: v1.54.0
args: --enable gofmt --timeout 10m --exclude SA5011 --verbose --max-issues-per-linter 0 --max-same-issues 0
version: v1.58.2
args: --verbose
test-go:
name: Run unit tests for Go packages
@ -533,4 +533,4 @@ jobs:
exit 0
else
exit 1
fi
fi

10
.golangci.yaml Normal file
View file

@ -0,0 +1,10 @@
issues:
exclude:
- SA5011
max-issues-per-linter: 0
max-same-issues: 0
linters:
enable:
- gofmt
run:
timeout: 50m

View file

@ -357,7 +357,7 @@ lint-local:
golangci-lint --version
# NOTE: If you get a "Killed" OOM message, try reducing the value of GOGC
# See https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint
GOGC=$(ARGOCD_LINT_GOGC) GOMAXPROCS=2 golangci-lint run --enable gofmt --fix --verbose --timeout 3000s --max-issues-per-linter 0 --max-same-issues 0
GOGC=$(ARGOCD_LINT_GOGC) GOMAXPROCS=2 golangci-lint run --fix --verbose
.PHONY: lint-ui
lint-ui: test-tools-image

View file

@ -1,4 +1,4 @@
#!/bin/bash
set -eux -o pipefail
GO111MODULE=on go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.0
GO111MODULE=on go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.58.2