Skip to content

Commit 33fe87b

Browse files
authored
result/processors: treat all non-Go source as special autogenerated files
Prior to this change golangci-lint would attempt to follow //line directives into generation description files unless they were in a small set of fake files used by goyacc. Now we consider all non-Go source as special.
1 parent 21be7d2 commit 33fe87b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/result/processors/autogenerated_exclude.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ func (p *AutogeneratedExclude) Process(issues []result.Issue) ([]result.Issue, e
4343

4444
func isSpecialAutogeneratedFile(filePath string) bool {
4545
fileName := filepath.Base(filePath)
46-
// fake files to which //line points to for goyacc generated files
47-
return fileName == "yacctab" || fileName == "yaccpar" || fileName == "NONE"
46+
// fake files or generation definitions to which //line points to for generated files
47+
return filepath.Ext(fileName) != ".go"
4848
}
4949

5050
func (p *AutogeneratedExclude) shouldPassIssue(i *result.Issue) (bool, error) {

0 commit comments

Comments
 (0)