@@ -46,21 +46,21 @@ func isSpecialAutogeneratedFile(filePath string) bool {
46
46
return filepath .Ext (fileName ) != ".go"
47
47
}
48
48
49
- func (p * AutogeneratedExclude ) shouldPassIssue (i * result.Issue ) (bool , error ) {
50
- if i .FromLinter == "typecheck" {
49
+ func (p * AutogeneratedExclude ) shouldPassIssue (issue * result.Issue ) (bool , error ) {
50
+ if issue .FromLinter == "typecheck" {
51
51
// don't hide typechecking errors in generated files: users expect to see why the project isn't compiling
52
52
return true , nil
53
53
}
54
54
55
- if filepath .Base (i .FilePath ()) == "go.mod" {
55
+ if filepath .Base (issue .FilePath ()) == "go.mod" {
56
56
return true , nil
57
57
}
58
58
59
- if isSpecialAutogeneratedFile (i .FilePath ()) {
59
+ if isSpecialAutogeneratedFile (issue .FilePath ()) {
60
60
return false , nil
61
61
}
62
62
63
- fs , err := p .getOrCreateFileSummary (i )
63
+ fs , err := p .getOrCreateFileSummary (issue )
64
64
if err != nil {
65
65
return false , err
66
66
}
@@ -92,26 +92,26 @@ func isGeneratedFileByComment(doc string) bool {
92
92
return false
93
93
}
94
94
95
- func (p * AutogeneratedExclude ) getOrCreateFileSummary (i * result.Issue ) (* ageFileSummary , error ) {
96
- fs := p .fileSummaryCache [i .FilePath ()]
95
+ func (p * AutogeneratedExclude ) getOrCreateFileSummary (issue * result.Issue ) (* ageFileSummary , error ) {
96
+ fs := p .fileSummaryCache [issue .FilePath ()]
97
97
if fs != nil {
98
98
return fs , nil
99
99
}
100
100
101
101
fs = & ageFileSummary {}
102
- p .fileSummaryCache [i .FilePath ()] = fs
102
+ p .fileSummaryCache [issue .FilePath ()] = fs
103
103
104
- if i .FilePath () == "" {
104
+ if issue .FilePath () == "" {
105
105
return nil , errors .New ("no file path for issue" )
106
106
}
107
107
108
- doc , err := getDoc (i .FilePath ())
108
+ doc , err := getDoc (issue .FilePath ())
109
109
if err != nil {
110
- return nil , fmt .Errorf ("failed to get doc of file %s: %w" , i .FilePath (), err )
110
+ return nil , fmt .Errorf ("failed to get doc of file %s: %w" , issue .FilePath (), err )
111
111
}
112
112
113
113
fs .isGenerated = isGeneratedFileByComment (doc )
114
- autogenDebugf ("file %q is generated: %t" , i .FilePath (), fs .isGenerated )
114
+ autogenDebugf ("file %q is generated: %t" , issue .FilePath (), fs .isGenerated )
115
115
return fs , nil
116
116
}
117
117
0 commit comments