Skip to content

Commit a95c15f

Browse files
.github: Bump golangci/golangci-lint-action from 6 to 7 (#273)
* .github: 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](golangci/golangci-lint-action@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] <[email protected]> * Introduce tools module - introduce tools module and remove tools.go - update golangci-lint to v2.0.2 - update Makefile install-tools target - fix any linter errors that cropped up - update CI action to work with golangci-lint v2 - add dependabot rule for updating Go tools - migrate .golangci.yml to v2 * go mod tidy * upgrade Go to 1.24.2 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lovro Mažgon <[email protected]>
1 parent 72d8495 commit a95c15f

File tree

8 files changed

+1032
-115
lines changed

8 files changed

+1032
-115
lines changed

.github/dependabot.yml

+8
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,11 @@ updates:
1717
interval: "daily"
1818
commit-message:
1919
prefix: "go.mod:"
20+
21+
# Maintain dependencies for Go tools
22+
- package-ecosystem: "gomod"
23+
directory: "/tools"
24+
schedule:
25+
interval: "weekly"
26+
commit-message:
27+
prefix: "Go tools:"

.github/workflows/lint.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ jobs:
2020
- name: Golangci-lint version
2121
id: golangci-lint-version
2222
run: |
23-
GOLANGCI_LINT_VERSION=$( go list -m -f '{{.Version}}' github.com/golangci/golangci-lint )
23+
GOLANGCI_LINT_VERSION=$( go list -modfile=tools/go.mod -m -f '{{.Version}}' github.com/golangci/golangci-lint/v2 )
2424
echo "v=$GOLANGCI_LINT_VERSION" >> "$GITHUB_OUTPUT"
2525
2626
- name: golangci-lint
27-
uses: golangci/golangci-lint-action@v6
27+
uses: golangci/golangci-lint-action@v7
2828
with:
2929
version: ${{ steps.golangci-lint-version.outputs.v }}
30-
args: --timeout=2m

.golangci.yml

+54-79
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,83 @@
1-
linters-settings:
2-
gofmt:
3-
simplify: false
4-
nolintlint:
5-
allow-unused: false # report any unused nolint directives
6-
require-explanation: true # require an explanation for nolint directives
7-
require-specific: true # require nolint directives to mention the specific linter being suppressed
8-
gocyclo:
9-
min-complexity: 20
10-
goconst:
11-
ignore-tests: true
12-
goheader:
13-
template-path: '.golangci.goheader.template'
14-
values:
15-
regexp:
16-
copyright-year: 20[2-9]\d
17-
forbidigo:
18-
forbid:
19-
- p: ^pgxpool\.New.*$
20-
msg: "Use github.com/conduitio/conduit-connector-postgres/source/cpool.New instead."
21-
issues:
22-
exclude-rules:
23-
- path: test/helper\.go
24-
linters:
25-
- gosec
26-
- path: source/cpool/cpool\.go
27-
linters:
28-
- forbidigo
29-
1+
version: "2"
302
linters:
31-
# please, do not use `enable-all`: it's deprecated and will be removed soon.
32-
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
33-
disable-all: true
3+
default: none
344
enable:
355
- bodyclose
366
- copyloopvar
37-
# - depguard
387
- dogsled
398
- durationcheck
409
- errcheck
4110
- errname
42-
# - errorlint
43-
# - exhaustive
44-
# - exhaustivestruct
4511
- forbidigo
46-
# - forcetypeassert
47-
# - funlen
48-
# - gochecknoinits
4912
- goconst
5013
- gocritic
5114
- gocyclo
52-
# - cyclop # not interested in package complexities at the moment
53-
# - godot
54-
- gofmt
55-
# - gofumpt
5615
- goheader
57-
- goimports
58-
- revive
59-
# - gomnd
6016
- gomoddirectives
6117
- gomodguard
6218
- goprintffuncname
6319
- gosec
64-
- gosimple
6520
- govet
66-
# - ifshort
6721
- ineffassign
68-
# - importas
69-
# - lll
70-
# - misspell
7122
- makezero
72-
# - nakedret
73-
# - nilerr
74-
# - nilnil
75-
# - nlreturn
7623
- noctx
7724
- nolintlint
78-
# - paralleltest
7925
- predeclared
26+
- revive
8027
- rowserrcheck
81-
- staticcheck
82-
- stylecheck
8328
- sqlclosecheck
84-
# - tagliatelle
85-
# - tenv
86-
# - thelper
87-
# - tparallel
88-
- typecheck
29+
- staticcheck
8930
- unconvert
90-
# - unparam
9131
- unused
9232
- wastedassign
9333
- whitespace
94-
# - wrapcheck
95-
# - wsl
96-
97-
# don't enable:
98-
# - asciicheck
99-
# - dupl
100-
# - gochecknoglobals
101-
# - gocognit
102-
# - godox
103-
# - goerr113
104-
# - maligned
105-
# - nestif
106-
# - prealloc
107-
# - testpackage
108-
# - wsl
34+
settings:
35+
forbidigo:
36+
forbid:
37+
- pattern: ^pgxpool\.New.*$
38+
msg: Use github.com/conduitio/conduit-connector-postgres/source/cpool.New instead.
39+
gocyclo:
40+
min-complexity: 20
41+
goheader:
42+
values:
43+
regexp:
44+
copyright-year: 20[2-9]\d
45+
template-path: .golangci.goheader.template
46+
nolintlint:
47+
require-explanation: true
48+
require-specific: true
49+
allow-unused: false
50+
exclusions:
51+
generated: lax
52+
presets:
53+
- comments
54+
- common-false-positives
55+
- legacy
56+
- std-error-handling
57+
rules:
58+
- linters:
59+
- gosec
60+
path: test/helper\.go
61+
- linters:
62+
- forbidigo
63+
path: source/cpool/cpool\.go
64+
- linters:
65+
- goconst
66+
path: (.+)_test\.go
67+
paths:
68+
- third_party$
69+
- builtin$
70+
- examples$
71+
formatters:
72+
enable:
73+
- gofmt
74+
- goimports
75+
settings:
76+
gofmt:
77+
simplify: false
78+
exclusions:
79+
generated: lax
80+
paths:
81+
- third_party$
82+
- builtin$
83+
- examples$

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test:
1414

1515
.PHONY: lint
1616
lint:
17-
golangci-lint run -v
17+
golangci-lint run
1818

1919
.PHONY: generate
2020
generate:
@@ -28,6 +28,6 @@ fmt:
2828

2929
.PHONY: install-tools
3030
install-tools:
31-
@echo Installing tools from tools.go
32-
@go list -e -f '{{ join .Imports "\n" }}' tools.go | xargs -tI % go install %
31+
@echo Installing tools from tools/go.mod
32+
@go list -modfile=tools/go.mod tool | xargs -I % go list -modfile=tools/go.mod -f "%@{{.Module.Version}}" % | xargs -tI % go install %
3333
@go mod tidy

go.mod

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
module github.com/conduitio/conduit-connector-postgres
22

3-
go 1.23.2
3+
go 1.24.2
44

55
require (
66
github.com/Masterminds/sprig/v3 v3.3.0
77
github.com/Masterminds/squirrel v1.5.4
88
github.com/conduitio/conduit-commons v0.5.2
99
github.com/conduitio/conduit-connector-sdk v0.13.3
10-
github.com/daixiang0/gci v0.13.6
11-
github.com/golangci/golangci-lint v1.64.8
1210
github.com/google/go-cmp v0.7.0
1311
github.com/google/uuid v1.6.0
1412
github.com/hamba/avro/v2 v2.28.0
@@ -17,9 +15,7 @@ require (
1715
github.com/jackc/pgx/v5 v5.7.4
1816
github.com/matryer/is v1.4.1
1917
github.com/rs/zerolog v1.34.0
20-
golang.org/x/tools v0.31.0
2118
gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637
22-
mvdan.cc/gofumpt v0.7.0
2319
)
2420

2521
require (
@@ -64,6 +60,7 @@ require (
6460
github.com/conduitio/evolviconf/evolviyaml v0.1.0 // indirect
6561
github.com/conduitio/yaml/v3 v3.3.0 // indirect
6662
github.com/curioswitch/go-reassign v0.3.0 // indirect
63+
github.com/daixiang0/gci v0.13.6 // indirect
6764
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
6865
github.com/denis-tingaikin/go-header v0.5.0 // indirect
6966
github.com/ettle/strcase v0.2.0 // indirect
@@ -90,6 +87,7 @@ require (
9087
github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 // indirect
9188
github.com/golangci/go-printf-func-name v0.1.0 // indirect
9289
github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d // indirect
90+
github.com/golangci/golangci-lint v1.64.8 // indirect
9391
github.com/golangci/misspell v0.6.0 // indirect
9492
github.com/golangci/plugin-module-register v0.1.1 // indirect
9593
github.com/golangci/revgrep v0.8.0 // indirect
@@ -232,12 +230,14 @@ require (
232230
golang.org/x/sys v0.31.0 // indirect
233231
golang.org/x/text v0.23.0 // indirect
234232
golang.org/x/time v0.11.0 // indirect
233+
golang.org/x/tools v0.31.0 // indirect
235234
google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 // indirect
236235
google.golang.org/grpc v1.71.0 // indirect
237236
google.golang.org/protobuf v1.36.5 // indirect
238237
gopkg.in/ini.v1 v1.67.0 // indirect
239238
gopkg.in/yaml.v2 v2.4.0 // indirect
240239
gopkg.in/yaml.v3 v3.0.1 // indirect
241240
honnef.co/go/tools v0.6.1 // indirect
241+
mvdan.cc/gofumpt v0.7.0 // indirect
242242
mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f // indirect
243243
)

tools.go

-25
This file was deleted.

0 commit comments

Comments
 (0)