Skip to content

Commit 3213c49

Browse files
committed
chore: update CI and golangci-lint configuration
- Update CI workflow to match gemfile-go setup - Update golangci-lint to v2 configuration format - Use Go 1.25 with go-version-file support - Add comprehensive linting rules
1 parent c540209 commit 3213c49

File tree

3 files changed

+84
-76
lines changed

3 files changed

+84
-76
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,17 @@ jobs:
4747

4848
steps:
4949
- name: Checkout code
50-
uses: actions/checkout@v4
50+
uses: actions/checkout@v5
5151

5252
- name: Setup Go
5353
uses: actions/setup-go@v6
5454
with:
55-
go-version-file: 'go.mod'
56-
57-
- name: Install Mage
58-
run: go install github.com/magefile/mage@latest
55+
go-version: stable
5956

60-
- name: Run linting
61-
run: mage lint
57+
- name: golangci-lint
58+
uses: golangci/golangci-lint-action@v8
59+
with:
60+
version: latest
6261

6362
examples:
6463
name: Validate Examples
@@ -77,4 +76,4 @@ jobs:
7776
run: go install github.com/magefile/mage@latest
7877

7978
- name: Run examples
80-
run: mage examples
79+
run: mage examples

.golangci.yml

Lines changed: 76 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,101 @@
1+
version: "2"
12
run:
2-
timeout: 5m
33
tests: true
4-
54
linters:
65
enable:
76
- bodyclose
87
- dogsled
98
- dupl
10-
- errcheck
119
- exhaustive
1210
- funlen
1311
- gochecknoinits
1412
- goconst
1513
- gocritic
1614
- gocyclo
17-
- gofmt
18-
- goimports
1915
- goprintffuncname
2016
- gosec
21-
- gosimple
22-
- govet
23-
- ineffassign
2417
- lll
2518
- misspell
2619
- nakedret
2720
- noctx
2821
- nolintlint
2922
- rowserrcheck
3023
- staticcheck
31-
- stylecheck
32-
- typecheck
3324
- unconvert
3425
- unparam
35-
- unused
3626
- whitespace
37-
38-
linters-settings:
39-
dupl:
40-
threshold: 100
41-
exhaustive:
42-
default-signifies-exhaustive: false
43-
funlen:
44-
lines: 100
45-
statements: 50
46-
goconst:
47-
min-len: 2
48-
min-occurrences: 2
49-
gocritic:
50-
enabled-tags:
51-
- diagnostic
52-
- experimental
53-
- opinionated
54-
- performance
55-
- style
56-
disabled-checks:
57-
- dupImport
58-
- ifElseChain
59-
- octalLiteral
60-
- whyNoLint
61-
- wrapperFunc
62-
gocyclo:
63-
min-complexity: 15
64-
goimports:
65-
local-prefixes: github.com/contriboss/gemfile-go
66-
govet:
67-
enable:
68-
- shadow
69-
lll:
70-
line-length: 140
71-
misspell:
72-
locale: US
73-
nolintlint:
74-
allow-leading-space: true
75-
allow-unused: false
76-
require-explanation: false
77-
require-specific: false
78-
79-
issues:
80-
exclude-dirs:
81-
- vendor
82-
- testdata
83-
exclude-rules:
84-
- path: _test\.go
85-
linters:
86-
- funlen
87-
- dupl
88-
89-
- path: examples/
90-
linters:
91-
- goconst
92-
- funlen
27+
settings:
28+
dupl:
29+
threshold: 100
30+
exhaustive:
31+
default-signifies-exhaustive: false
32+
funlen:
33+
lines: 100
34+
statements: 50
35+
goconst:
36+
min-len: 2
37+
min-occurrences: 2
38+
gocritic:
39+
disabled-checks:
40+
- dupImport
41+
- ifElseChain
42+
- octalLiteral
43+
- whyNoLint
44+
- wrapperFunc
45+
enabled-tags:
46+
- diagnostic
47+
- experimental
48+
- opinionated
49+
- performance
50+
- style
51+
gocyclo:
52+
min-complexity: 15
53+
govet:
54+
enable:
55+
- shadow
56+
lll:
57+
line-length: 140
58+
misspell:
59+
locale: US
60+
nolintlint:
61+
require-explanation: false
62+
require-specific: false
63+
allow-unused: false
64+
exclusions:
65+
generated: lax
66+
presets:
67+
- comments
68+
- common-false-positives
69+
- legacy
70+
- std-error-handling
71+
rules:
72+
- linters:
73+
- dupl
74+
- funlen
75+
path: _test\.go
76+
- linters:
77+
- funlen
78+
- goconst
79+
path: examples/
80+
paths:
81+
- vendor
82+
- testdata
83+
- third_party$
84+
- builtin$
85+
- examples$
86+
formatters:
87+
enable:
88+
- gofmt
89+
- goimports
90+
settings:
91+
goimports:
92+
local-prefixes:
93+
- github.com/contriboss/rubygems-client-go
94+
exclusions:
95+
generated: lax
96+
paths:
97+
- vendor
98+
- testdata
99+
- third_party$
100+
- builtin$
101+
- examples$

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ repos:
2121
hooks:
2222
- id: go-fmt
2323
- id: go-imports
24-
- id: go-mod-tidy
24+
- id: go-mod-tidy

0 commit comments

Comments
 (0)