Skip to content

Commit 634fb4c

Browse files
authored
Merge pull request #127 from oschwald/greg/golangci-lint-2
Upgrade to golangci-lint 2
2 parents 576a46d + 549f0ff commit 634fb4c

File tree

6 files changed

+179
-197
lines changed

6 files changed

+179
-197
lines changed

Diff for: .github/workflows/go.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
name: Build
99
strategy:
1010
matrix:
11-
go-version: [1.21.x, 1.22.x]
11+
go-version: [1.23.x, 1.24.x]
1212
platform: [ubuntu-latest, macos-latest, windows-latest]
1313
runs-on: ${{ matrix.platform }}
1414
steps:

Diff for: .github/workflows/golangci-lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v4
1111
- name: golangci-lint
12-
uses: golangci/golangci-lint-action@v6
12+
uses: golangci/golangci-lint-action@v7
1313
with:
1414
version: latest

Diff for: .golangci.toml

-192
This file was deleted.

Diff for: .golangci.yml

+174
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
version: "2"
2+
run:
3+
go: "1.23"
4+
tests: true
5+
allow-parallel-runners: true
6+
linters:
7+
default: all
8+
disable:
9+
- cyclop
10+
- depguard
11+
- err113
12+
- exhaustive
13+
- exhaustruct
14+
- forcetypeassert
15+
- funlen
16+
- gochecknoglobals
17+
- gocognit
18+
- godox
19+
- gosmopolitan
20+
- inamedparam
21+
- interfacebloat
22+
- mnd
23+
- nlreturn
24+
- nonamedreturns
25+
- paralleltest
26+
- testpackage
27+
- thelper
28+
- varnamelen
29+
- wrapcheck
30+
- wsl
31+
settings:
32+
errorlint:
33+
errorf: true
34+
asserts: true
35+
comparison: true
36+
exhaustive:
37+
default-signifies-exhaustive: true
38+
forbidigo:
39+
forbid:
40+
- pattern: Geoip
41+
msg: you should use `GeoIP`
42+
- pattern: geoIP
43+
msg: you should use `geoip`
44+
- pattern: Maxmind
45+
msg: you should use `MaxMind`
46+
- pattern: ^maxMind
47+
msg: you should use `maxmind`
48+
- pattern: Minfraud
49+
msg: you should use `MinFraud`
50+
- pattern: ^minFraud
51+
msg: you should use `minfraud`
52+
- pattern: ^math.Max$
53+
msg: you should use the max built-in instead.
54+
- pattern: ^math.Min$
55+
msg: you should use the min built-in instead.
56+
- pattern: ^os.IsNotExist
57+
msg: As per their docs, new code should use errors.Is(err, fs.ErrNotExist).
58+
- pattern: ^os.IsExist
59+
msg: As per their docs, new code should use errors.Is(err, fs.ErrExist)
60+
gosec:
61+
excludes:
62+
- G115
63+
govet:
64+
disable:
65+
- shadow
66+
enable-all: true
67+
lll:
68+
line-length: 120
69+
tab-width: 4
70+
misspell:
71+
locale: US
72+
extra-words:
73+
- typo: marshall
74+
correction: marshal
75+
- typo: marshalling
76+
correction: marshaling
77+
- typo: marshalls
78+
correction: marshals
79+
- typo: unmarshall
80+
correction: unmarshal
81+
- typo: unmarshalling
82+
correction: unmarshaling
83+
- typo: unmarshalls
84+
correction: unmarshals
85+
nolintlint:
86+
require-explanation: true
87+
require-specific: true
88+
allow-no-explanation:
89+
- lll
90+
- misspell
91+
allow-unused: false
92+
revive:
93+
severity: warning
94+
enable-all-rules: true
95+
rules:
96+
- name: add-constant
97+
disabled: true
98+
- name: cognitive-complexity
99+
disabled: true
100+
- name: confusing-naming
101+
disabled: true
102+
- name: confusing-results
103+
disabled: true
104+
- name: cyclomatic
105+
disabled: true
106+
- name: deep-exit
107+
disabled: true
108+
- name: flag-parameter
109+
disabled: true
110+
- name: function-length
111+
disabled: true
112+
- name: function-result-limit
113+
disabled: true
114+
- name: line-length-limit
115+
disabled: true
116+
- name: max-public-structs
117+
disabled: true
118+
- name: nested-structs
119+
disabled: true
120+
- name: unchecked-type-assertion
121+
disabled: true
122+
- name: unhandled-error
123+
disabled: true
124+
tagliatelle:
125+
case:
126+
rules:
127+
avro: snake
128+
bson: snake
129+
env: upperSnake
130+
envconfig: upperSnake
131+
json: snake
132+
mapstructure: snake
133+
xml: snake
134+
yaml: snake
135+
unparam:
136+
check-exported: true
137+
exclusions:
138+
generated: lax
139+
presets:
140+
- comments
141+
- common-false-positives
142+
- legacy
143+
- std-error-handling
144+
rules:
145+
- linters:
146+
- govet
147+
- revive
148+
path: _test.go
149+
text: 'fieldalignment:'
150+
paths:
151+
- third_party$
152+
- builtin$
153+
- examples$
154+
formatters:
155+
enable:
156+
- gci
157+
- gofmt
158+
- gofumpt
159+
- goimports
160+
- golines
161+
settings:
162+
gci:
163+
sections:
164+
- standard
165+
- default
166+
- prefix(github.com/oschwald/geoip2-golang)
167+
gofumpt:
168+
extra-rules: true
169+
exclusions:
170+
generated: lax
171+
paths:
172+
- third_party$
173+
- builtin$
174+
- examples$

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/oschwald/geoip2-golang
22

3-
go 1.21
3+
go 1.23.0
44

55
require (
66
github.com/oschwald/maxminddb-golang v1.13.1

0 commit comments

Comments
 (0)