mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-02 14:46:31 +00:00
c28f7cb29f
Initial part of #435
20 lines
461 B
Go
20 lines
461 B
Go
package facts
|
|
|
|
import (
|
|
"reflect"
|
|
|
|
"golang.org/x/tools/go/analysis"
|
|
"honnef.co/go/tools/analysis/lint"
|
|
)
|
|
|
|
func directives(pass *analysis.Pass) (interface{}, error) {
|
|
return lint.ParseDirectives(pass.Files, pass.Fset), nil
|
|
}
|
|
|
|
var Directives = &analysis.Analyzer{
|
|
Name: "directives",
|
|
Doc: "extracts linter directives",
|
|
Run: directives,
|
|
RunDespiteErrors: true,
|
|
ResultType: reflect.TypeOf([]lint.Directive{}),
|
|
}
|