Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1d4f00f

Browse files
committed
chore: update example
1 parent5b227ae commit1d4f00f

File tree

4 files changed

+42
-33
lines changed

4 files changed

+42
-33
lines changed

‎.golangci.example.yml‎

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
linters-settings:
2-
custom:
3-
example:
4-
# Path is required
5-
path:example.so
6-
# Description is optional
7-
description:The description of the linter. This is optional, but shows up when running `golangci-lint linters`.
8-
# Original-url is optional, and is only used for documentation purposes.
9-
original-url:github.com/golangci/example-plugin-linter
10-
settings:
11-
one:Foo
12-
two:
13-
-name:Bar
14-
three:
15-
name:Bar
1+
version:"2"
162

173
linters:
18-
disable-all:true
4+
default:none
195
enable:
206
-example
7+
8+
settings:
9+
custom:
10+
example:
11+
# Path is required
12+
path:example.so
13+
# Description is optional
14+
description:The description of the linter. This is optional, but shows up when running `golangci-lint linters`.
15+
# Original-url is optional, and is only used for documentation purposes.
16+
original-url:github.com/golangci/example-plugin-linter
17+
settings:
18+
one:Foo
19+
three:
20+
name:Bar
21+
two:
22+
-name:Bar

‎README.md‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,19 @@ If you're looking for instructions on how to configure your own custom linter, t
2929
1. If the project you want to lint does not have one already, copy the[.golangci.yml](https://github.com/golangci/golangci-lint/blob/master/.golangci.yml) to the root directory.
3030
2. Adjust the YAML to appropriate`linters-settings.custom` entries as so:
3131
```yaml
32-
linters-settings:
33-
custom:
34-
example:
35-
path:/example.so
36-
description:The description of the linter
37-
original-url:github.com/golangci/example-linter
38-
settings:# Settings are optional.
39-
one:Foo
40-
two:
41-
-name:Bar
42-
three:
43-
name:Bar
32+
linters:
33+
settings:
34+
custom:
35+
example:
36+
path:/example.so
37+
description:The description of the linter
38+
original-url:github.com/golangci/example-linter
39+
settings:# Settings are optional.
40+
one:Foo
41+
two:
42+
-name:Bar
43+
three:
44+
name:Bar
4445
```
4546
4647
That is all the configuration that is required to run a custom linter in your project.

‎go.mod‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ module github.com/golangci/example-linter
22

33
// All versions here need to be the same as in golangci-lint/mod.go if present
44

5-
go1.21
5+
go1.23.0
66

77
require (
8-
github.com/stretchr/testifyv1.9.0
9-
golang.org/x/toolsv0.22.0
8+
github.com/stretchr/testifyv1.10.0
9+
golang.org/x/toolsv0.32.0
1010
)
1111

1212
require (
1313
github.com/davecgh/go-spewv1.1.1// indirect
1414
github.com/pmezard/go-difflibv1.0.0// indirect
15-
golang.org/x/modv0.18.0// indirect
16-
golang.org/x/syncv0.7.0// indirect
15+
golang.org/x/modv0.24.0// indirect
16+
golang.org/x/syncv0.13.0// indirect
1717
gopkg.in/yaml.v3v3.0.1// indirect
1818
)

‎go.sum‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
44
github.com/pmezard/go-difflibv1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
55
github.com/stretchr/testifyv1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
66
github.com/stretchr/testifyv1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
7+
github.com/stretchr/testifyv1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
8+
github.com/stretchr/testifyv1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
79
golang.org/x/modv0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
810
golang.org/x/modv0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
11+
golang.org/x/modv0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
912
golang.org/x/syncv0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
1013
golang.org/x/syncv0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
14+
golang.org/x/syncv0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
1115
golang.org/x/toolsv0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
1216
golang.org/x/toolsv0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=
17+
golang.org/x/toolsv0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU=
18+
golang.org/x/toolsv0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s=
1319
gopkg.in/check.v1v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1420
gopkg.in/check.v1v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
1521
gopkg.in/yaml.v3v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp