@@ -72,6 +72,8 @@ type conformanceData struct {
72
72
TestName string
73
73
// Extracted from the "Description:" comment before the test
74
74
Description string
75
+ // Version when this test is added or modified ex: v1.12, v1.13
76
+ Release string
75
77
}
76
78
77
79
func (v * visitor ) convertToConformanceData (at * ast.BasicLit ) {
@@ -85,13 +87,16 @@ func (v *visitor) convertToConformanceData(at *ast.BasicLit) {
85
87
cd .Description = ""
86
88
for _ , line := range lines {
87
89
line = strings .TrimSpace (line )
88
- if strings .HasPrefix (line , "Testname:" ) {
89
- line = strings .TrimSpace (line [9 :])
90
- cd .TestName = line
90
+ if sline := regexp .MustCompile ("^Testname\\ s*:\\ s*" ).Split (line , - 1 ); len (sline ) == 2 {
91
+ cd .TestName = sline [1 ]
91
92
continue
92
93
}
93
- if strings .HasPrefix (line , "Description:" ) {
94
- line = strings .TrimSpace (line [12 :])
94
+ if sline := regexp .MustCompile ("^Release\\ s*:\\ s*" ).Split (line , - 1 ); len (sline ) == 2 {
95
+ cd .Release = sline [1 ]
96
+ continue
97
+ }
98
+ if sline := regexp .MustCompile ("^Description\\ s*:\\ s*" ).Split (line , - 1 ); len (sline ) == 2 {
99
+ line = sline [1 ]
95
100
}
96
101
cd .Description += line + "\n "
97
102
}
@@ -341,6 +346,7 @@ func main() {
341
346
tests := scanfile (path , nil )
342
347
for _ , cd := range tests {
343
348
fmt .Printf ("## [%s](%s)\n \n " , cd .TestName , cd .URL )
349
+ fmt .Printf ("### Release %s\n " , cd .Release )
344
350
fmt .Printf ("%s\n \n " , cd .Description )
345
351
if len (cd .Description ) < 10 {
346
352
missingComments ++
0 commit comments