forked from gojp/goreportcard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
go_vet.go
27 lines (22 loc) · 846 Bytes
/
go_vet.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package check
// GoVet is the check for the go vet command
type GoVet struct {
Dir string
Filenames []string
}
// Name returns the name of the display name of the command
func (g GoVet) Name() string {
return "go_vet"
}
// Weight returns the weight this check has in the overall average
func (g GoVet) Weight() float64 {
return .35
}
// Percentage returns the percentage of .go files that pass go vet
func (g GoVet) Percentage() (float64, []FileSummary, error) {
return GoTool(g.Dir, g.Filenames, []string{"gometalinter", "--deadline=180s", "--disable-all", "--enable=vet"})
}
// Description returns the description of go lint
func (g GoVet) Description() string {
return `<code>go vet</code> examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.`
}