Skip to content

Commit aa141d8

Browse files
committed
Update golangci-lint and zerolint version
Signed-off-by: Oliver Eikemeier <[email protected]>
1 parent c56af47 commit aa141d8

File tree

8 files changed

+131
-70
lines changed

8 files changed

+131
-70
lines changed

.custom-gcl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
version: v1.63.4
2+
version: v2.0.2
33
plugins:
44
- module: fillmore-labs.com/zerolint-golangci-plugin
55
path: .

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-24.04
1919
strategy:
2020
matrix:
21-
go-version: ["1.24.0-rc.3", "1.23.6", "1.22.12"]
21+
go-version: ["1.24.2", "1.23.8"]
2222
env:
2323
GOTOOLCHAIN: local
2424
steps:
@@ -29,9 +29,9 @@ jobs:
2929
with:
3030
go-version: ${{ matrix.go-version }}
3131
- name: 🧸 golangci-lint
32-
uses: golangci/golangci-lint-action@v6
32+
uses: golangci/golangci-lint-action@v7
3333
with:
34-
version: v1.63.4
34+
version: v2.0.2
3535
args: --config=.golangci-default.yaml
3636
- name: 🔨 Test
3737
run: golangci-lint custom -v && ./custom-gcl run -v .

.golangci-default.yaml

Lines changed: 77 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
---
2+
version: "2"
3+
24
run:
35
modules-download-mode: readonly
6+
7+
formatters:
8+
enable:
9+
- gofumpt
10+
settings:
11+
gofumpt:
12+
module-path: fillmore-labs.com/zerolint
13+
414
linters:
5-
enable-all: true
15+
default: all
616
disable:
7-
# deprecated
8-
- exportloopref
9-
# disabled
1017
- depguard
1118
- dupl
1219
- exhaustruct
@@ -15,34 +22,69 @@ linters:
1522
- varnamelen
1623
- wrapcheck
1724
- wsl
18-
linters-settings:
19-
govet:
20-
enable-all: true
21-
disable:
22-
- fieldalignment
23-
settings:
24-
shadow:
25-
strict: true
26-
testifylint:
27-
enable-all: true
28-
disable:
29-
- require-error
30-
ireturn:
31-
allow:
32-
- anon
33-
- error
34-
- empty
35-
- stdlib
36-
- generic
37-
predeclared:
38-
ignore: "new"
39-
issues:
40-
exclude-rules:
41-
- path: _test\.go$
42-
linters:
43-
- revive
44-
text: "dot-imports"
45-
- path: _test\.go$
46-
linters:
47-
- govet
48-
text: "lostcancel"
25+
settings:
26+
errcheck:
27+
exclude-functions:
28+
- (io/fs.File).Close
29+
govet:
30+
enable-all: true
31+
disable:
32+
- fieldalignment
33+
settings:
34+
shadow:
35+
strict: true
36+
testifylint:
37+
enable-all: true
38+
disable:
39+
- require-error
40+
ireturn:
41+
allow:
42+
- anon
43+
- error
44+
- empty
45+
- stdlib
46+
- generic
47+
predeclared:
48+
ignore: ["new"]
49+
revive:
50+
rules:
51+
- name: atomic
52+
- name: blank-imports
53+
- name: context-as-argument
54+
- name: context-keys-type
55+
- name: dot-imports
56+
exclude: ["TEST"]
57+
- name: early-return
58+
- name: error-return
59+
- name: error-strings
60+
- name: error-naming
61+
- name: increment-decrement
62+
- name: var-naming
63+
- name: var-declaration
64+
- name: range
65+
- name: receiver-naming
66+
- name: time-naming
67+
- name: unexported-return
68+
- name: indent-error-flow
69+
- name: errorf
70+
- name: empty-block
71+
- name: superfluous-else
72+
- name: unused-parameter
73+
- name: unreachable-code
74+
- name: redefines-builtin-id
75+
- name: file-header
76+
arguments:
77+
- "Copyright 2024 Oliver Eikemeier. All Rights Reserved."
78+
exclusions:
79+
rules:
80+
- path: _test\.go$
81+
linters:
82+
- govet
83+
text: "lostcancel"
84+
- path: ^main\.go$
85+
linters:
86+
- gocheckcompilerdirectives
87+
text: "go:debug"
88+
- linters:
89+
- govet
90+
text: '^shadow: declaration of "(ctx|err|ok)" shadows declaration at line \d+$'

.golangci.yaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
---
2+
version: "2"
3+
24
run:
3-
go: "1.22.9"
5+
go: 1.23.8
46
modules-download-mode: readonly
7+
58
linters:
69
enable:
710
- zerolint
8-
linters-settings:
9-
custom:
10-
zerolint:
11-
type: module
12-
settings:
13-
excluded: []
14-
basic: true
11+
settings:
12+
custom:
13+
zerolint:
14+
type: module
15+
settings:
16+
full: false
17+
excluded: []

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Add a file `.custom-gcl.yaml` to your source with
1010

1111
```YAML
1212
---
13-
version: v1.63.4
13+
version: v2.0.2
1414
plugins:
1515
- module: fillmore-labs.com/zerolint-golangci-plugin
16-
version: v0.0.7
16+
version: v0.0.8
1717
```
1818
1919
then run `golangci-lint custom`. You get an `custom-gcl` executable that can be configured in `.golangci.yaml`:
@@ -23,13 +23,13 @@ then run `golangci-lint custom`. You get an `custom-gcl` executable that can be
2323
linters:
2424
enable:
2525
- zerolint
26-
linters-settings:
27-
custom:
28-
zerolint:
29-
type: "module"
30-
settings:
31-
basic: false
32-
excluded: []
26+
settings:
27+
custom:
28+
zerolint:
29+
type: module
30+
settings:
31+
full: false
32+
excluded: []
3333
```
3434

3535
and can be used like `golangci-lint`:

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module fillmore-labs.com/zerolint-golangci-plugin
22

3-
go 1.22.0
3+
go 1.23.0
44

5-
toolchain go1.23.6
5+
toolchain go1.24.2
66

77
require (
8-
fillmore-labs.com/zerolint v0.0.7
8+
fillmore-labs.com/zerolint v0.0.8
99
github.com/golangci/plugin-module-register v0.1.1
10-
golang.org/x/tools v0.29.0
10+
golang.org/x/tools v0.31.0
1111
)

go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
fillmore-labs.com/zerolint v0.0.7 h1:ffxijMuW4Zm2550MFbWEwVBYavpOyANIWBpfnXJxmMM=
2-
fillmore-labs.com/zerolint v0.0.7/go.mod h1:+qGQ3b6Fp26aWFFU0OXPyEeUrUuD6zXleM7aaS4ZzSE=
1+
fillmore-labs.com/zerolint v0.0.8 h1:AqtUcOqRBXExBk0RoOmgVS7c/s17ICfvhYLG1ZUXWdI=
2+
fillmore-labs.com/zerolint v0.0.8/go.mod h1:4ZBySqMSeBOwT4Q3nUl0NUS2/RvhDNTvgIhybmABdRA=
33
github.com/golangci/plugin-module-register v0.1.1 h1:TCmesur25LnyJkpsVrupv1Cdzo+2f7zX0H6Jkw1Ol6c=
44
github.com/golangci/plugin-module-register v0.1.1/go.mod h1:TTpqoB6KkwOJMV8u7+NyXMrkwwESJLOkfl9TxR1DGFc=
5-
golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
6-
golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
7-
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
8-
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
9-
golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE=
10-
golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588=
5+
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
6+
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
7+
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
8+
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
9+
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
10+
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=

plugin.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
// Copyright 2024 Oliver Eikemeier. All Rights Reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
// SPDX-License-Identifier: Apache-2.0
16+
117
package plugin
218

319
import (
@@ -15,7 +31,7 @@ func init() { //nolint:gochecknoinits
1531

1632
type Settings struct {
1733
Excluded []string `json:"excluded"`
18-
Basic bool `json:"basic"`
34+
Full bool `json:"full"`
1935
}
2036

2137
func New(settings any) (register.LinterPlugin, error) { //nolint:ireturn
@@ -34,7 +50,7 @@ type Plugin struct {
3450
func (p Plugin) BuildAnalyzers() ([]*analysis.Analyzer, error) {
3551
run := analyzer.NewRun(
3652
analyzer.WithExcludes(p.settings.Excluded),
37-
analyzer.WithBasic(p.settings.Basic),
53+
analyzer.WithFull(p.settings.Full),
3854
analyzer.WithGenerated(true),
3955
)
4056

0 commit comments

Comments
 (0)