diff --git a/.github/workflows/build-syncthing.yaml b/.github/workflows/build-syncthing.yaml index 32dc07f98..4daeffb08 100644 --- a/.github/workflows/build-syncthing.yaml +++ b/.github/workflows/build-syncthing.yaml @@ -127,6 +127,7 @@ jobs: - package-debian - package-windows - govulncheck + - golangci steps: - uses: actions/checkout@v4 @@ -1020,3 +1021,22 @@ jobs: go run build.go assets go install golang.org/x/vuln/cmd/govulncheck@latest govulncheck ./... + + golangci: + runs-on: ubuntu-latest + name: Run golangci-lint + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + cache: false + check-latest: true + + - name: ensure asset generation + run: go run build.go assets + + - name: golangci-lint + uses: golangci/golangci-lint-action@v8 + with: + only-new-issues: true diff --git a/.golangci.yml b/.golangci.yml index dfabd1205..b5b8239ff 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,39 +1,67 @@ +version: "2" linters: - enable-all: true + default: all disable: - cyclop - depguard - exhaustive - exhaustruct + - forbidigo - funlen - - gci - gochecknoglobals - gochecknoinits - gocognit - goconst - gocyclo - godox - - gofmt - - goimports - gomoddirectives - inamedparam - interfacebloat - ireturn - lll - maintidx + - mnd + - musttag - nestif + - nlreturn - nonamedreturns - paralleltest + - prealloc + - predeclared - protogetter - - scopelint + - recvcheck + - revive - tagalign - tagliatelle - testpackage + - usetesting # go 1.24 - varnamelen + - whitespace + - wrapcheck - wsl - -issues: - exclude-dirs: - - internal/gen - - cmd/dev - - repos \ No newline at end of file + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - internal/gen + - cmd/dev + - repos + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofumpt + exclusions: + generated: lax + paths: + - internal/gen + - cmd/dev + - repos + - third_party$ + - builtin$ + - examples$