Skip to content

Commit 4426f51

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

File tree

9 files changed

+34
-18
lines changed

9 files changed

+34
-18
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: v2.0.2
2+
version: v2.1.1
33
plugins:
44
- module: fillmore-labs.com/zerolint-golangci-plugin
55
path: .

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: 🧸 golangci-lint
3232
uses: golangci/golangci-lint-action@v7
3333
with:
34-
version: v2.0.2
34+
version: v2.1.1
3535
args: --config=.golangci-default.yaml
3636
- name: 🔨 Test
3737
run: golangci-lint custom -v && ./custom-gcl run -v .

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
!/.golangci.yaml
1111
!/.markdownlint.yaml
1212
!/.mockery.yaml
13+
!/.pre-commit-config.yaml
1314
!/.prettierrc.yaml
1415
!/.yamlfmt
1516
!/.yamllint

.golangci-default.yaml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,29 @@ linters:
5555
- name: dot-imports
5656
exclude: ["TEST"]
5757
- name: early-return
58+
arguments:
59+
- allow-jump: true
60+
- name: empty-block
61+
- name: error-naming
5862
- name: error-return
5963
- name: error-strings
60-
- name: error-naming
64+
- name: errorf
65+
- name: exported
66+
- name: file-header
67+
arguments:
68+
- "Copyright 2024 Oliver Eikemeier. All Rights Reserved."
6169
- name: increment-decrement
62-
- name: var-naming
63-
- name: var-declaration
70+
- name: indent-error-flow
6471
- name: range
6572
- name: receiver-naming
73+
- name: redefines-builtin-id
74+
- name: superfluous-else
6675
- name: time-naming
6776
- name: unexported-return
68-
- name: indent-error-flow
69-
- name: errorf
70-
- name: empty-block
71-
- name: superfluous-else
72-
- name: unused-parameter
7377
- name: unreachable-code
74-
- name: redefines-builtin-id
75-
- name: file-header
76-
arguments:
77-
- "Copyright 2024 Oliver Eikemeier. All Rights Reserved."
78+
- name: unused-parameter
79+
- name: var-declaration
80+
- name: var-naming
7881
exclusions:
7982
rules:
8083
- path: _test\.go$

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
repos:
3+
- repo: https://github.com/google/yamlfmt
4+
rev: v0.16.0
5+
hooks:
6+
- id: yamlfmt

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Add a file `.custom-gcl.yaml` to your source with
1010

1111
```YAML
1212
---
13-
version: v2.0.2
13+
version: v2.1.1
1414
plugins:
1515
- module: fillmore-labs.com/zerolint-golangci-plugin
1616
version: v0.0.8

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ toolchain go1.24.2
77
require (
88
fillmore-labs.com/zerolint v0.0.8
99
github.com/golangci/plugin-module-register v0.1.1
10-
golang.org/x/tools v0.31.0
10+
golang.org/x/tools v0.32.0
1111
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
66
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
77
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
88
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=
9+
golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU=
10+
golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s=

plugin.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,20 @@ import (
2323
"golang.org/x/tools/go/analysis/passes/inspect"
2424
)
2525

26+
// Name is the linters name.
2627
const Name = "zerolint"
2728

2829
func init() { //nolint:gochecknoinits
2930
register.Plugin(Name, New)
3031
}
3132

33+
// Settings are the linters settings.
3234
type Settings struct {
3335
Excluded []string `json:"excluded"`
3436
Full bool `json:"full"`
3537
}
3638

39+
// New creates a new [Plugin] instance with the given [Settings].
3740
func New(settings any) (register.LinterPlugin, error) { //nolint:ireturn
3841
s, err := register.DecodeSettings[Settings](settings)
3942
if err != nil {
@@ -43,10 +46,12 @@ func New(settings any) (register.LinterPlugin, error) { //nolint:ireturn
4346
return Plugin{settings: s}, nil
4447
}
4548

49+
// Plugin is a zerolint linter as a [register.LinterPlugin].
4650
type Plugin struct {
4751
settings Settings
4852
}
4953

54+
// BuildAnalyzers returns the [analysis.Analyzer]s for a zerolint run.
5055
func (p Plugin) BuildAnalyzers() ([]*analysis.Analyzer, error) {
5156
run := analyzer.NewRun(
5257
analyzer.WithExcludes(p.settings.Excluded),
@@ -64,6 +69,7 @@ func (p Plugin) BuildAnalyzers() ([]*analysis.Analyzer, error) {
6469
return []*analysis.Analyzer{analyzer}, nil
6570
}
6671

72+
// GetLoadMode returns the golangci load mode.
6773
func (Plugin) GetLoadMode() string {
6874
return register.LoadModeTypesInfo
6975
}

0 commit comments

Comments
 (0)