mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-28 22:39:05 +08:00
Add errcheck check
This commit is contained in:
27
check/errcheck.go
Normal file
27
check/errcheck.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package check
|
||||
|
||||
// ErrCheck is the check for the go fmt command
|
||||
type ErrCheck struct {
|
||||
Dir string
|
||||
Filenames []string
|
||||
}
|
||||
|
||||
// Name returns the name of the display name of the command
|
||||
func (c ErrCheck) Name() string {
|
||||
return "errcheck"
|
||||
}
|
||||
|
||||
// Weight returns the weight this check has in the overall average
|
||||
func (c ErrCheck) Weight() float64 {
|
||||
return .15
|
||||
}
|
||||
|
||||
// Percentage returns the percentage of .go files that pass gofmt
|
||||
func (c ErrCheck) Percentage() (float64, []FileSummary, error) {
|
||||
return GoTool(c.Dir, c.Filenames, []string{"gometalinter", "--deadline=180s", "--disable-all", "--enable=errcheck"})
|
||||
}
|
||||
|
||||
// Description returns the description of gofmt
|
||||
func (c ErrCheck) Description() string {
|
||||
return `<a href="https://github.com/kisielk/errcheck">errcheck</a> finds unchecked errors in go programs`
|
||||
}
|
||||
Reference in New Issue
Block a user