Skip to content

Commit 725d530

Browse files
committed
Release 0.0.14
maintanace, update dependencies Signed-off-by: Oliver Eikemeier <eikemeier@fillmore-labs.com>
1 parent 754783f commit 725d530

37 files changed

Lines changed: 270 additions & 236 deletions

.github/workflows/test.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,44 +17,49 @@ jobs:
1717
pull-requests: read
1818
statuses: write
1919
runs-on: ubuntu-24.04-arm
20+
timeout-minutes: 10
2021
strategy:
2122
matrix:
2223
go: ["1.25", "1.24"]
2324
include:
2425
- go: "1.25"
25-
go-version: "1.25.0"
26-
update-meta: true
26+
go-version: "1.25.4"
27+
latest: true
2728
- go: "1.24"
28-
go-version: "1.24.6"
29+
go-version: "1.24.10"
2930
env:
3031
GOTOOLCHAIN: local
3132
steps:
3233
- name: ✔ Check out
33-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
34+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
35+
with:
36+
persist-credentials: false
3437
- name: 🐹 Set up Go ${{ matrix.go-version }}
35-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
38+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
3639
with:
3740
go-version: ${{ matrix.go-version }}
3841
cache-dependency-path: "**/go.sum"
42+
- name: 📠 Go Telemetry
43+
run: go telemetry on
3944
- name: 🧸 golangci-lint
40-
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
45+
uses: golangci/golangci-lint-action@0a35821d5c230e903fcfe077583637dea1b27b47 # v9.0.0
46+
if: ${{ matrix.latest }}
4147
with:
42-
version: v2.4.0
48+
version: v2.6.2
49+
verify: false
4350
- name: 🔨 Test
4451
run: |
4552
(cd ./pkg/internal/analyzer/testdata && go mod download)
4653
go test -coverprofile=cover.out ./...
47-
env:
48-
GOEXPERIMENT: aliastypeparams
4954
- name: 🧑🏻‍💻 codecov
50-
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
51-
if: ${{ matrix.update-meta }}
55+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
56+
if: ${{ matrix.latest }}
5257
with:
5358
files: ./cover.out
5459
token: ${{ secrets.CODECOV_TOKEN }}
5560
- name: 🛜 Dependencies
5661
uses: actions/go-dependency-submission@f35d5c9af13ce9cc32f7930b171e315e878f6921 # v2.0.3
57-
if: ${{ matrix.update-meta }}
62+
if: ${{ matrix.latest }}
5863
with:
5964
go-mod-path: go.mod
6065
go-build-target: .

.golangci.yaml

Lines changed: 73 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,78 @@ formatters:
1717
- fillmore-labs.com/zerolint
1818

1919
linters:
20-
default: all
21-
disable:
20+
enable:
2221
# keep-sorted start
23-
- depguard
24-
- dupl
25-
- embeddedstructfieldcheck
26-
- exhaustruct
27-
- forbidigo
28-
- forcetypeassert
29-
- funcorder
30-
- funlen
31-
- gocognit
32-
- noinlineerr
33-
- nonamedreturns
34-
- recvcheck
35-
- varnamelen
36-
- wrapcheck
37-
- wsl
22+
- copyloopvar
23+
- errcheck
24+
- errname
25+
- exptostd
26+
- gocheckcompilerdirectives
27+
- gochecksumtype
28+
- gocritic
29+
- godot
30+
- goheader
31+
- gomoddirectives
32+
- gosec
33+
- govet
34+
- iface
35+
- inamedparam
36+
- ineffassign
37+
- intrange
38+
- mirror
39+
- misspell
40+
- modernize
41+
- nlreturn
42+
- nolintlint
43+
- paralleltest
44+
- perfsprint
45+
- predeclared
46+
- reassign
47+
- revive
48+
- sloglint
49+
- staticcheck
50+
- tagalign
51+
- tagliatelle
52+
- testableexamples
53+
- thelper
54+
- tparallel
55+
- unconvert
56+
- unparam
57+
- unused
58+
- usestdlibvars
59+
- usetesting
60+
- wsl_v5
3861
# keep-sorted end
3962
settings:
4063
# keep-sorted start
41-
cyclop:
42-
max-complexity: 20
4364
errcheck:
4465
exclude-functions:
4566
- (io/fs.File).Close
46-
gocognit:
47-
min-complexity: 30
67+
- (*os.File).Close
68+
- (*github.com/goccy/go-yaml.Encoder).Close
69+
verbose: true
70+
goheader:
71+
values:
72+
const:
73+
AUTHOR: Oliver Eikemeier
74+
regexp:
75+
RANGE: "2024-2025|2025"
76+
template: |-
77+
Copyright {{ RANGE }} {{ AUTHOR }}. All Rights Reserved.
78+
79+
Licensed under the Apache License, Version 2.0 (the "License");
80+
you may not use this file except in compliance with the License.
81+
You may obtain a copy of the License at
82+
83+
http://www.apache.org/licenses/LICENSE-2.0
84+
85+
Unless required by applicable law or agreed to in writing, software
86+
distributed under the License is distributed on an "AS IS" BASIS,
87+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
88+
See the License for the specific language governing permissions and
89+
limitations under the License.
90+
91+
SPDX-License-Identifier: Apache-2.0
4892
govet:
4993
enable-all: true
5094
disable:
@@ -56,15 +100,8 @@ linters:
56100
funcs:
57101
- fillmore-labs.com/zerolint/pkg/internal/analyzer/msg.Formatf
58102
- (*fillmore-labs.com/zerolint/pkg/internal/diag.Diag).LogErrorf
59-
ireturn:
60-
allow:
61-
- anon
62-
- error
63-
- empty
64-
- stdlib
65-
- generic
66-
mnd:
67-
ignored-numbers: ["2", "3", "-1"]
103+
nlreturn:
104+
block-size: 2
68105
predeclared:
69106
ignore: ["new"]
70107
revive:
@@ -85,9 +122,6 @@ linters:
85122
- name: error-strings
86123
- name: errorf
87124
- name: exported
88-
- name: file-header
89-
arguments:
90-
- "Copyright 2024-2025 Oliver Eikemeier. All Rights Reserved."
91125
- name: increment-decrement
92126
- name: indent-error-flow
93127
- name: range
@@ -101,21 +135,18 @@ linters:
101135
- name: var-declaration
102136
- name: var-naming
103137
# keep-sorted end
104-
testifylint:
105-
enable-all: true
106-
disable:
107-
- require-error
138+
tagliatelle:
139+
case:
140+
rules:
141+
json: kebab
142+
yaml: kebab
143+
use-field-name: true
108144
wsl_v5:
109145
disable:
110146
- assign
111147
# keep-sorted end
112148
exclusions:
113149
rules:
114-
- path: _test\.go$
115-
linters:
116-
- funlen
117-
- govet
118-
text: "lostcancel"
119150
- path: ^main\.go$
120151
linters:
121152
- gocheckcompilerdirectives

.pre-commit-config.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22
# yaml-language-server: $schema=https://json.schemastore.org/pre-commit-config.json
33
repos:
44
- repo: https://github.com/google/yamlfmt
5-
rev: v0.17.2
5+
rev: v0.20.0
66
hooks:
77
- id: yamlfmt
8+
types: [yaml]
89
- repo: https://github.com/google/keep-sorted
9-
rev: v0.6.1
10+
rev: v0.7.1
1011
hooks:
1112
- id: keep-sorted
1213
- repo: https://github.com/DavidAnson/markdownlint-cli2
13-
rev: v0.18.1
14+
rev: v0.19.0
1415
hooks:
1516
- id: markdownlint-cli2
1617
- repo: https://github.com/golangci/golangci-lint
17-
rev: v2.4.0
18+
rev: v2.6.2
1819
hooks:
1920
- id: golangci-lint

doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ To check the current package for basic problems with pointers to zero-sized type
5151
5252
zerolint .
5353
54-
To fix all issues across packages, unsing an exclude file:
54+
To fix all issues across packages, using an exclude file:
5555
5656
zerolint -level=full -exclude=excludes.txt -fix ./...
5757
*/

go.mod

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

33
go 1.24.0
44

5-
toolchain go1.25.0
5+
toolchain go1.25.4
66

7-
require golang.org/x/tools v0.36.0
7+
require golang.org/x/tools v0.39.0
88

99
require (
10-
golang.org/x/mod v0.27.0 // indirect
11-
golang.org/x/sync v0.16.0 // indirect
10+
golang.org/x/mod v0.30.0 // indirect
11+
golang.org/x/sync v0.18.0 // indirect
1212
)

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
22
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
3-
golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ=
4-
golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc=
5-
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
6-
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
7-
golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg=
8-
golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s=
3+
golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk=
4+
golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc=
5+
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
6+
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
7+
golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ=
8+
golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ=

pkg/internal/analyzer/analyzer_test.go

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func TestAnalyzer(t *testing.T) { //nolint:funlen
6363
}{
6464
{"basic", args{level: level.Basic, regex: testre, pkg: "test/basic"}, "test/basic.myError (value methods)"},
6565
{"full", args{level: level.Full, excludes: set.New(excludedTypeNames...), pkg: "test/a"}, "[0]string"},
66-
{"exclusions", args{level: level.Full, pkg: "test/e"}, ""},
66+
{"exclusions", args{level: level.Full, pkg: "test/e"}, "test/e.NotExcluded"},
6767
}
6868
for _, tt := range tests {
6969
t.Run(tt.name, func(t *testing.T) {
@@ -79,7 +79,6 @@ func TestAnalyzer(t *testing.T) { //nolint:funlen
7979
if tt.args.regex != nil && tt.args.regex.String() != "" {
8080
v.Check.Regex = tt.args.regex
8181
}
82-
8382
a := &analysis.Analyzer{
8483
Name: "zerolint",
8584
Doc: "...",
@@ -90,16 +89,9 @@ func TestAnalyzer(t *testing.T) { //nolint:funlen
9089

9190
res := analysistest.RunWithSuggestedFixes(t, dir, a, tt.args.pkg)
9291

93-
if tt.want != "" {
94-
d := res[0].Result.(result.Detected) //nolint:forcetypeassert
95-
if d.Empty() {
96-
t.Error("Expected detection of zero-sized types")
97-
}
98-
99-
zerotypes := d.Sorted()
100-
if !slices.Contains(zerotypes, tt.want) {
101-
t.Errorf("Expected %q to contain %q", zerotypes, tt.want)
102-
}
92+
d := res[0].Result.(result.Detected) //nolint:forcetypeassert
93+
if zerotypes := d.Sorted(); !slices.Contains(zerotypes, tt.want) {
94+
t.Errorf("Expected %q to contain %q", zerotypes, tt.want)
10395
}
10496
})
10597
}

pkg/internal/analyzer/msg/category.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package msg
1818

1919
import "fillmore-labs.com/zerolint/pkg/internal/diag"
2020

21-
//nolint:godot,revive
21+
//nolint:godot,revive,godoclint
2222
const (
2323
// keep-sorted start
2424
CatAddress diag.Category = "add"

pkg/internal/analyzer/msg/cmp_test.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ func TestComparisonMessage(t *testing.T) {
7575
t.Run(tc.name, func(t *testing.T) {
7676
t.Parallel()
7777

78-
got := ComparisonMessage(tc.left, tc.right, tc.valueMethod)
79-
80-
if !strings.Contains(got.Message, tc.want) {
78+
if got := ComparisonMessage(tc.left, tc.right, tc.valueMethod); !strings.Contains(got.Message, tc.want) {
8179
t.Errorf("ComparisonMessage() returned %q, does not contain %q", got.Message, tc.want)
8280
}
8381
})
@@ -127,9 +125,7 @@ func TestComparisonMessagePointerInterface(t *testing.T) {
127125
t.Run(tc.name, func(t *testing.T) {
128126
t.Parallel()
129127

130-
got := ComparisonMessagePointerInterface(tc.elemOp, tc.interfaceOp, tc.valueMethod)
131-
132-
if !strings.Contains(got.Message, tc.want) {
128+
if got := ComparisonMessagePointerInterface(tc.elemOp, tc.interfaceOp, tc.valueMethod); !strings.Contains(got.Message, tc.want) {
133129
t.Errorf("ComparisonMessagePointerInterface() returned %q, does not contain %q", got.Message, tc.want)
134130
}
135131
})

pkg/internal/analyzer/returns_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func nestedReturn() {
8181

8282
// Find the function declaration we want to test
8383
var targetNode ast.Node
84+
8485
for fn := range typeutil.AllDecls[*ast.FuncDecl](files) {
8586
if fn.Name.Name == tc.funcName {
8687
targetNode = fn

0 commit comments

Comments
 (0)