@@ -46,21 +46,21 @@ func isSpecialAutogeneratedFile(filePath string) bool {
4646 return filepath .Ext (fileName ) != ".go"
4747}
4848
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" {
5151 // don't hide typechecking errors in generated files: users expect to see why the project isn't compiling
5252 return true , nil
5353 }
5454
55- if filepath .Base (i .FilePath ()) == "go.mod" {
55+ if filepath .Base (issue .FilePath ()) == "go.mod" {
5656 return true , nil
5757 }
5858
59- if isSpecialAutogeneratedFile (i .FilePath ()) {
59+ if isSpecialAutogeneratedFile (issue .FilePath ()) {
6060 return false , nil
6161 }
6262
63- fs , err := p .getOrCreateFileSummary (i )
63+ fs , err := p .getOrCreateFileSummary (issue )
6464 if err != nil {
6565 return false , err
6666 }
@@ -92,26 +92,26 @@ func isGeneratedFileByComment(doc string) bool {
9292 return false
9393}
9494
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 ()]
9797 if fs != nil {
9898 return fs , nil
9999 }
100100
101101 fs = & ageFileSummary {}
102- p .fileSummaryCache [i .FilePath ()] = fs
102+ p .fileSummaryCache [issue .FilePath ()] = fs
103103
104- if i .FilePath () == "" {
104+ if issue .FilePath () == "" {
105105 return nil , errors .New ("no file path for issue" )
106106 }
107107
108- doc , err := getDoc (i .FilePath ())
108+ doc , err := getDoc (issue .FilePath ())
109109 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 )
111111 }
112112
113113 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 )
115115 return fs , nil
116116}
117117
0 commit comments