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.
This commit is contained in:
Dan Kortschak 2020-12-11 17:07:28 +10:30 committed by GitHub
parent 21be7d2dcf
commit 33fe87b2a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,8 +43,8 @@ func (p *AutogeneratedExclude) Process(issues []result.Issue) ([]result.Issue, e
func isSpecialAutogeneratedFile(filePath string) bool {
fileName := filepath.Base(filePath)
// fake files to which //line points to for goyacc generated files
return fileName == "yacctab" || fileName == "yaccpar" || fileName == "NONE"
// fake files or generation definitions to which //line points to for generated files
return filepath.Ext(fileName) != ".go"
}
func (p *AutogeneratedExclude) shouldPassIssue(i *result.Issue) (bool, error) {