From bfe89a1fc3b2dd2a94ea437736ab0b175de596ca Mon Sep 17 00:00:00 2001 From: Vasiliy Vasilyuk Date: Sat, 5 Apr 2025 11:40:03 +0300 Subject: [PATCH] Bump golangci/golangci-lint-action from 6 to 7 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6 to 7. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v6...v7) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/go.yml | 6 ++--- .golangci.yml | 51 +++++++++++++++++++++++++------------ Makefile | 2 +- testingpg/testingpg_test.go | 1 + 4 files changed, 40 insertions(+), 20 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 328309b..2ec9a80 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -69,8 +69,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.22.0 + go-version: 1.24.1 - name: golangci-lint - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@v7 with: - version: v1.55.2 + version: v2.0.2 diff --git a/.golangci.yml b/.golangci.yml index a230ad0..80955a9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,30 +1,49 @@ --- +version: "2" linters: - disable-all: true + default: none enable: - errcheck - godot - - gofumpt - - goimports - - gosimple - govet - ineffassign - misspell - staticcheck - testifylint - testpackage - - typecheck - unused - whitespace - wsl - -linters-settings: - goimports: - local-prefixes: github.com/xorcare/testing-go-code-with-postgres - gofumpt: - module-path: github.com/xorcare/testing-go-code-with-postgres - unused: - field-writes-are-uses: false - post-statements-are-reads: true - exported-fields-are-used: false - local-variables-are-used: false + settings: + unused: + field-writes-are-uses: false + post-statements-are-reads: true + exported-fields-are-used: false + local-variables-are-used: false + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofumpt + - goimports + settings: + gofumpt: + module-path: github.com/xorcare/testing-go-code-with-postgres + goimports: + local-prefixes: + - github.com/xorcare/testing-go-code-with-postgres + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/Makefile b/Makefile index a925adf..3b43b67 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ lint: tools ## Check the project with lint. .PHONY: tools tools: ## Install all needed tools, e.g. - @go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 + @go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.0.2 .PHONY: help help: ## Show help for each of the Makefile targets. diff --git a/testingpg/testingpg_test.go b/testingpg/testingpg_test.go index 8b1dd78..9e7823c 100644 --- a/testingpg/testingpg_test.go +++ b/testingpg/testingpg_test.go @@ -204,6 +204,7 @@ func TestNewWithTransactionalCleanup(t *testing.T) { // Arrange ctx := context.Background() + const sqlStr = `CREATE TABLE "no_conflict" (id integer PRIMARY KEY)` t.Run("Arrange", func(t *testing.T) {