From 284b5f6d909ccf2c8597ddecedfa2fb03cd4516b Mon Sep 17 00:00:00 2001 From: Walter Schulze Date: Mon, 21 Apr 2025 17:57:03 +0200 Subject: [PATCH 1/3] try new golang lint --- .github/workflows/build.yaml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4f2ee74..0392397 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -31,7 +31,7 @@ jobs: path: src/github.com/goccmack/gocc - name: golangci-lint - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@v7 with: version: v1.60 args: --issues-exit-code=0 # Do not care about output, we run golangci-lint in the Makefile again and then we do care. diff --git a/Makefile b/Makefile index 7ae29a2..fd4d4e9 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ ci-lint: ## see https://golangci-lint.run/, applies .golangci.yml lint: make govet - ## make ci-lint ## Temporarily disabled for go 1.24 until golangci-lint supports go 1.24 + make ci-lint goclean: gofmt ## apply go style rules to source From b92609931c38bc0d5978cca98efbe8314b73bd43 Mon Sep 17 00:00:00 2001 From: Walter Schulze Date: Mon, 21 Apr 2025 17:58:29 +0200 Subject: [PATCH 2/3] update golangci-lint version --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0392397..9fad8d5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -33,7 +33,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v7 with: - version: v1.60 + version: v2.1.2 args: --issues-exit-code=0 # Do not care about output, we run golangci-lint in the Makefile again and then we do care. working-directory: ${{env.working-directory}} install-mode: "goinstall" # This is slow, but necessary if you are using a newer version of Go than golangci-lint supports From 7326e7f097800ccc30667794750fc8957212f766 Mon Sep 17 00:00:00 2001 From: Walter Schulze Date: Mon, 21 Apr 2025 18:11:31 +0200 Subject: [PATCH 3/3] update golangci-lint version --- .golangci.yml | 30 +++++++++++++++++++++++------- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index e551778..5e3def0 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,20 +1,36 @@ -run: - timeout: 60s +version: "2" linters: enable: - dogsled - dupl - - errcheck - gocyclo - - gofmt - - goimports - misspell - prealloc - unconvert - whitespace disable: - - unused - depguard - govet - staticcheck - + - unused + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/go.mod b/go.mod index 12fa93c..571fd5c 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/goccmack/gocc go 1.24 -require golang.org/x/mod v0.8.0 +require golang.org/x/mod v0.24.0 diff --git a/go.sum b/go.sum index 083110b..eb2dd0f 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= +golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=