You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/golinters/godoclint/testdata/godoclint_full_fail_most_rules.go
+26-26Lines changed: 26 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -12,74 +12,74 @@ import "go/ast"
12
12
13
13
// Asserting rule "start-with-name"
14
14
15
-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
15
+
// bad godoc // want `godoc should start with symbol name \("FooType"\)`
16
16
typeFooTypestruct{}
17
17
18
-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
18
+
// bad godoc // want `godoc should start with symbol name \("FooAlias"\)`
19
19
typeFooAlias= ast.Comment
20
20
21
-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
21
+
// bad godoc // want `godoc should start with symbol name \("FooConst"\)`
22
22
constFooConst=1
23
23
24
-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
24
+
// bad godoc // want `godoc should start with symbol name \("FooVar"\)`
25
25
varFooVar=1
26
26
27
-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
27
+
// bad godoc // want `godoc should start with symbol name \("FooFunc"\)`
28
28
funcFooFunc() {}
29
29
30
-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
30
+
// bad godoc // want `godoc should start with symbol name \("FooFunc"\)`
31
31
func (FooType) FooFunc() {}
32
32
33
-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
33
+
// bad godoc // want `godoc should start with symbol name \("fooType"\)`
34
34
typefooTypestruct{}
35
35
36
-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
36
+
// bad godoc // want `godoc should start with symbol name \("fooAlias"\)`
37
37
typefooAlias= ast.Comment
38
38
39
-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
39
+
// bad godoc // want `godoc should start with symbol name \("fooConst"\)`
40
40
constfooConst=1
41
41
42
-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
42
+
// bad godoc // want `godoc should start with symbol name \("fooVar"\)`
43
43
varfooVar=1
44
44
45
-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
45
+
// bad godoc // want `godoc should start with symbol name \("fooFunc"\)`
46
46
funcfooFunc() {}
47
47
48
-
// bad godoc // want `godoc should start with symbol name \(pattern "GODOC %"\)`
48
+
// bad godoc // want `godoc should start with symbol name \("fooFunc"\)`
49
49
func (FooType) fooFunc() {}
50
50
51
51
// Asserting rule "require-doc"
52
52
53
53
// The //foo:bar directives mark the trailing comment as a directive so they're
54
54
// not parsed as a normal trailing comment group.
55
55
56
-
typeBarTypestruct{} //foo:bar // want `symbol should have a godoc \(BarType\)`
56
+
typeBarTypestruct{} //foo:bar // want `symbol should have a godoc \("BarType"\)`
57
57
58
-
typeBarAlias= ast.Comment//foo:bar // want `symbol should have a godoc \(BarAlias\)`
58
+
typeBarAlias= ast.Comment//foo:bar // want `symbol should have a godoc \("BarAlias"\)`
59
59
60
-
constBarConst=1//foo:bar // want `symbol should have a godoc \(BarConst\)`
60
+
constBarConst=1//foo:bar // want `symbol should have a godoc \("BarConst"\)`
61
61
62
-
varBarVar=1//foo:bar // want `symbol should have a godoc \(BarVar\)`
62
+
varBarVar=1//foo:bar // want `symbol should have a godoc \("BarVar"\)`
63
63
64
-
funcBarFunc() {} //foo:bar // want `symbol should have a godoc \(BarFunc\)`
64
+
funcBarFunc() {} //foo:bar // want `symbol should have a godoc \("BarFunc"\)`
65
65
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"\)`
67
67
68
-
typebarTypestruct{} //foo:bar // want `symbol should have a godoc \(barType\)`
68
+
typebarTypestruct{} //foo:bar // want `symbol should have a godoc \("barType"\)`
69
69
70
-
typebarAlias= ast.Comment//foo:bar // want `symbol should have a godoc \(barAlias\)`
70
+
typebarAlias= ast.Comment//foo:bar // want `symbol should have a godoc \("barAlias"\)`
71
71
72
-
constbarConst=1//foo:bar // want `symbol should have a godoc \(barConst\)`
72
+
constbarConst=1//foo:bar // want `symbol should have a godoc \("barConst"\)`
73
73
74
-
varbarVar=1//foo:bar // want `symbol should have a godoc \(barVar\)`
74
+
varbarVar=1//foo:bar // want `symbol should have a godoc \("barVar"\)`
75
75
76
-
funcbarFunc() {} //foo:bar // want `symbol should have a godoc \(barFunc\)`
76
+
funcbarFunc() {} //foo:bar // want `symbol should have a godoc \("barFunc"\)`
77
77
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"\)`
79
79
80
80
// Asserting rule "no-unused-link"
81
81
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"\)`
83
83
//
84
84
// [used]: https://example.com
85
85
//
@@ -88,5 +88,5 @@ const constWithUnusedLink = 1
88
88
89
89
// Asserting rule "max-len"
90
90
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\)`
0 commit comments