Skip to content

Commit 6616bf1

Browse files
committed
fix: upgrade godoclint to v0.7.0
Signed-off-by: Babak K. Shandiz <[email protected]>
1 parent 8c6788a commit 6616bf1

File tree

4 files changed

+35
-33
lines changed

4 files changed

+35
-33
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ require (
4545
github.com/go-critic/go-critic v0.13.0
4646
github.com/go-viper/mapstructure/v2 v2.4.0
4747
github.com/go-xmlfmt/xmlfmt v1.1.3
48-
github.com/godoc-lint/godoc-lint v0.6.1
48+
github.com/godoc-lint/godoc-lint v0.7.0
4949
github.com/gofrs/flock v0.12.1
5050
github.com/golangci/asciicheck v0.5.0
5151
github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32

go.sum

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/golinters/godoclint/testdata/godoclint_default_fail.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ package testdata
77
// godoclint can, but must not, detect.
88
import "go/ast"
99

10-
// bad godoc // want `godoc should start with symbol name \(pattern "\(\(A\|a\|An\|an\|THE\|The\|the\) \)\?%"\)`
10+
// bad godoc // want `godoc should start with symbol name \("FooType"\)`
1111
type FooType struct{}
1212

13-
// bad godoc // want `godoc should start with symbol name \(pattern "\(\(A\|a\|An\|an\|THE\|The\|the\) \)\?%"\)`
13+
// bad godoc // want `godoc should start with symbol name \("FooAlias"\)`
1414
type FooAlias = ast.Comment
1515

16-
// bad godoc // want `godoc should start with symbol name \(pattern "\(\(A\|a\|An\|an\|THE\|The\|the\) \)\?%"\)`
16+
// bad godoc // want `godoc should start with symbol name \("FooConst"\)`
1717
const FooConst = 1
1818

19-
// bad godoc // want `godoc should start with symbol name \(pattern "\(\(A\|a\|An\|an\|THE\|The\|the\) \)\?%"\)`
19+
// bad godoc // want `godoc should start with symbol name \("FooVar"\)`
2020
var FooVar = 1
2121

22-
// bad godoc // want `godoc should start with symbol name \(pattern "\(\(A\|a\|An\|an\|THE\|The\|the\) \)\?%"\)`
22+
// bad godoc // want `godoc should start with symbol name \("FooFunc"\)`
2323
func FooFunc() {}
2424

25-
// bad godoc // want `godoc should start with symbol name \(pattern "\(\(A\|a\|An\|an\|THE\|The\|the\) \)\?%"\)`
25+
// bad godoc // want `godoc should start with symbol name \("FooFunc"\)`
2626
func (FooType) FooFunc() {}

pkg/golinters/godoclint/testdata/godoclint_full_fail_most_rules.go

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,74 +12,74 @@ import "go/ast"
1212

1313
// Asserting rule "start-with-name"
1414

15-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
15+
// bad godoc // want `godoc should start with symbol name \("FooType"\)`
1616
type FooType struct{}
1717

18-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
18+
// bad godoc // want `godoc should start with symbol name \("FooAlias"\)`
1919
type FooAlias = ast.Comment
2020

21-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
21+
// bad godoc // want `godoc should start with symbol name \("FooConst"\)`
2222
const FooConst = 1
2323

24-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
24+
// bad godoc // want `godoc should start with symbol name \("FooVar"\)`
2525
var FooVar = 1
2626

27-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
27+
// bad godoc // want `godoc should start with symbol name \("FooFunc"\)`
2828
func FooFunc() {}
2929

30-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
30+
// bad godoc // want `godoc should start with symbol name \("FooFunc"\)`
3131
func (FooType) FooFunc() {}
3232

33-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
33+
// bad godoc // want `godoc should start with symbol name \("fooType"\)`
3434
type fooType struct{}
3535

36-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
36+
// bad godoc // want `godoc should start with symbol name \("fooAlias"\)`
3737
type fooAlias = ast.Comment
3838

39-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
39+
// bad godoc // want `godoc should start with symbol name \("fooConst"\)`
4040
const fooConst = 1
4141

42-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
42+
// bad godoc // want `godoc should start with symbol name \("fooVar"\)`
4343
var fooVar = 1
4444

45-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
45+
// bad godoc // want `godoc should start with symbol name \("fooFunc"\)`
4646
func fooFunc() {}
4747

48-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
48+
// bad godoc // want `godoc should start with symbol name \("fooFunc"\)`
4949
func (FooType) fooFunc() {}
5050

5151
// Asserting rule "require-doc"
5252

5353
// The //foo:bar directives mark the trailing comment as a directive so they're
5454
// not parsed as a normal trailing comment group.
5555

56-
type BarType struct{} //foo:bar // want `symbol should have a godoc \(BarType\)`
56+
type BarType struct{} //foo:bar // want `symbol should have a godoc \("BarType"\)`
5757

58-
type BarAlias = ast.Comment //foo:bar // want `symbol should have a godoc \(BarAlias\)`
58+
type BarAlias = ast.Comment //foo:bar // want `symbol should have a godoc \("BarAlias"\)`
5959

60-
const BarConst = 1 //foo:bar // want `symbol should have a godoc \(BarConst\)`
60+
const BarConst = 1 //foo:bar // want `symbol should have a godoc \("BarConst"\)`
6161

62-
var BarVar = 1 //foo:bar // want `symbol should have a godoc \(BarVar\)`
62+
var BarVar = 1 //foo:bar // want `symbol should have a godoc \("BarVar"\)`
6363

64-
func BarFunc() {} //foo:bar // want `symbol should have a godoc \(BarFunc\)`
64+
func BarFunc() {} //foo:bar // want `symbol should have a godoc \("BarFunc"\)`
6565

66-
func (BarType) BarFunc() {} //foo:bar // want `symbol should have a godoc \(BarFunc\)`
66+
func (BarType) BarFunc() {} //foo:bar // want `symbol should have a godoc \("BarFunc"\)`
6767

68-
type barType struct{} //foo:bar // want `symbol should have a godoc \(barType\)`
68+
type barType struct{} //foo:bar // want `symbol should have a godoc \("barType"\)`
6969

70-
type barAlias = ast.Comment //foo:bar // want `symbol should have a godoc \(barAlias\)`
70+
type barAlias = ast.Comment //foo:bar // want `symbol should have a godoc \("barAlias"\)`
7171

72-
const barConst = 1 //foo:bar // want `symbol should have a godoc \(barConst\)`
72+
const barConst = 1 //foo:bar // want `symbol should have a godoc \("barConst"\)`
7373

74-
var barVar = 1 //foo:bar // want `symbol should have a godoc \(barVar\)`
74+
var barVar = 1 //foo:bar // want `symbol should have a godoc \("barVar"\)`
7575

76-
func barFunc() {} //foo:bar // want `symbol should have a godoc \(barFunc\)`
76+
func barFunc() {} //foo:bar // want `symbol should have a godoc \("barFunc"\)`
7777

78-
func (BarType) barFunc() {} //foo:bar // want `symbol should have a godoc \(barFunc\)`
78+
func (BarType) barFunc() {} //foo:bar // want `symbol should have a godoc \("barFunc"\)`
7979

8080
// Asserting rule "no-unused-link"
8181

82-
// GODOC constWithUnusedLink point to [used] and unused links. // want `godoc has unused link \(unused\)`
82+
// GODOC constWithUnusedLink point to [used] and unused links. // want `godoc has unused link \("unused"\)`
8383
//
8484
// [used]: https://example.com
8585
//
@@ -88,5 +88,5 @@ const constWithUnusedLink = 1
8888

8989
// Asserting rule "max-len"
9090

91-
// GODOC constWithTooLongGodoc has a very long godoc that exceeds the maximum allowed length for godoc comments in this test setup. // want `godoc exceeds max length \(177 > 127\)`
91+
// GODOC constWithTooLongGodoc has a very long godoc that exceeds the maximum allowed length for godoc comments in this test setup. // want `godoc line is too long \(175 > 127\)`
9292
const constWithTooLongGodoc = 1

0 commit comments

Comments
 (0)