Skip to content

Commit

Permalink
Update zerolint version
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Eikemeier <[email protected]>
  • Loading branch information
eikemeier committed Feb 10, 2025
1 parent b82162d commit c56af47
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .custom-gcl.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: v1.62.0
version: v1.63.4
plugins:
- module: fillmore-labs.com/zerolint-golangci-plugin
path: .
11 changes: 5 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: Test
- main
jobs:
test:
name: Test on Go ${{ matrix.go }}
name: Test on Go ${{ matrix.go-version }}
permissions:
checks: write
contents: read
Expand All @@ -18,21 +18,20 @@ jobs:
runs-on: ubuntu-24.04
strategy:
matrix:
go: ["1.23.3", "1.22.9"]
go-version: ["1.24.0-rc.3", "1.23.6", "1.22.12"]
env:
GOTOOLCHAIN: local
steps:
- name: ✔ Check out
uses: actions/checkout@v4
- name: 🐹 Set up Go ${{ matrix.go }}
- name: 🐹 Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
check-latest: true
go-version: ${{ matrix.go-version }}
- name: 🧸 golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.62.0
version: v1.63.4
args: --config=.golangci-default.yaml
- name: 🔨 Test
run: golangci-lint custom -v && ./custom-gcl run -v .
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Add a file `.custom-gcl.yaml` to your source with

```YAML
---
version: v1.62.0
version: v1.63.4
plugins:
- module: fillmore-labs.com/zerolint-golangci-plugin
version: v0.0.6
version: v0.0.7
```
then run `golangci-lint custom`. You get an `custom-gcl` executable that can be configured in `.golangci.yaml`:
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module fillmore-labs.com/zerolint-golangci-plugin

go 1.22.9
go 1.22.0

toolchain go1.23.3
toolchain go1.23.6

require (
fillmore-labs.com/zerolint v0.0.6
fillmore-labs.com/zerolint v0.0.7
github.com/golangci/plugin-module-register v0.1.1
golang.org/x/tools v0.27.0
golang.org/x/tools v0.29.0
)
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
fillmore-labs.com/zerolint v0.0.6 h1:pFGSYnXtnpMuzo5NxJ1IDMaOA3DZuijL1IJm1h1l/yY=
fillmore-labs.com/zerolint v0.0.6/go.mod h1:bX+KNByQeomQ6eDFkfw+OORPA1J4UIN1pSdPZz0wo9M=
fillmore-labs.com/zerolint v0.0.7 h1:ffxijMuW4Zm2550MFbWEwVBYavpOyANIWBpfnXJxmMM=
fillmore-labs.com/zerolint v0.0.7/go.mod h1:+qGQ3b6Fp26aWFFU0OXPyEeUrUuD6zXleM7aaS4ZzSE=
github.com/golangci/plugin-module-register v0.1.1 h1:TCmesur25LnyJkpsVrupv1Cdzo+2f7zX0H6Jkw1Ol6c=
github.com/golangci/plugin-module-register v0.1.1/go.mod h1:TTpqoB6KkwOJMV8u7+NyXMrkwwESJLOkfl9TxR1DGFc=
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o=
golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q=
golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE=
golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588=
23 changes: 5 additions & 18 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package plugin

import (
"fillmore-labs.com/zerolint/pkg/analyzer"
"fillmore-labs.com/zerolint/pkg/visitor"
"github.com/golangci/plugin-module-register/register"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
Expand Down Expand Up @@ -33,23 +32,11 @@ type Plugin struct {
}

func (p Plugin) BuildAnalyzers() ([]*analysis.Analyzer, error) {
run := func(pass *analysis.Pass) (any, error) {
excludes := make(map[string]struct{}, len(p.settings.Excluded))
for _, ex := range p.settings.Excluded {
excludes[ex] = struct{}{}
}

v := visitor.Run{
Visitor: visitor.Visitor{
Pass: pass,
Excludes: excludes,
},
Basic: p.settings.Basic,
}
v.Run()

return any(nil), nil
}
run := analyzer.NewRun(
analyzer.WithExcludes(p.settings.Excluded),
analyzer.WithBasic(p.settings.Basic),
analyzer.WithGenerated(true),
)

analyzer := &analysis.Analyzer{
Name: Name,
Expand Down

0 comments on commit c56af47

Please sign in to comment.