Skip to content

Commit

Permalink
ci(lint): create .golangci.yaml (#18410)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 authored May 25, 2024
1 parent d871b7f commit cd3c478
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -533,4 +533,4 @@ jobs:
exit 0
else
exit 1
fi
fi
10 changes: 10 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
issues:
exclude:
- SA5011
max-issues-per-linter: 0
max-same-issues: 0
linters:
enable:
- gofmt
run:
timeout: 50m
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hack/installers/install-lint-tools.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit cd3c478

Please sign in to comment.