From 448a8f50e09368ef06083bc94de9187aad519a5d Mon Sep 17 00:00:00 2001 From: SREsAreHumanToo <88474954+sresarehumantoo@users.noreply.github.com> Date: Sat, 21 Nov 2026 11:03:08 -0500 Subject: [PATCH] Add golangci-lint to CI --- .github/workflows/ci.yml | 4 ++++ .gitlab-ci.yml | 2 ++ .golangci.yml | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 .golangci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6e85b0..39ba364 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,10 @@ jobs: run: test -z "$(gofmt -l cmd internal)" || { echo "gofmt needed:"; gofmt -l cmd internal; exit 1; } - name: go vet run: go vet ./... + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: latest test: runs-on: ubuntu-latest diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a51ac1d..8db2ceb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,6 +32,8 @@ lint: script: - test -z "$(gofmt -l cmd internal)" || { echo "gofmt needed:"; gofmt -l cmd internal; exit 1; } - go vet ./... + - go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + - golangci-lint run ./... test: stage: test diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..92caa33 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,19 @@ +linters: + enable: + - errcheck + - gosimple + - govet + - ineffassign + - staticcheck + - unused + - gosec + disable-all: true + +linters-settings: + gosec: + excludes: + - G404 # math/rand is used intentionally for obfuscation seeded from crypto/rand + +issues: + exclude-dirs: + - dist