diff --git a/check/errcheck.go b/check/errcheck.go new file mode 100644 index 0000000..e61a09e --- /dev/null +++ b/check/errcheck.go @@ -0,0 +1,27 @@ +package check + +// errcheck is the check for the errcheck command +type Errcheck struct { + Dir string + Filenames []string +} + +// Name returns the name of the display name of the command +func (e Errcheck) Name() string { + return "errcheck" +} + +// Weight returns the weight this check has in the overall average +func (e Errcheck) Weight() float64 { + return .10 +} + +// Percentage returns the percentage of .go files that pass errcheck +func (e Errcheck) Percentage() (float64, []FileSummary, error) { + return GoTool(e.Dir, e.Filenames, []string{"gometalinter", "--deadline=180s", "--disable-all", "--enable=errcheck", "--min-confidence=0.85"}) +} + +// Description returns the description of errcheck +func (e Errcheck) Description() string { + return `errcheck checks that you checked errors.` +} diff --git a/handlers/checks.go b/handlers/checks.go index df80136..1eb8c72 100644 --- a/handlers/checks.go +++ b/handlers/checks.go @@ -183,6 +183,7 @@ func newChecksResp(repo string, forceRefresh bool) (checksResp, error) { check.GoLint{Dir: dir, Filenames: filenames}, check.GoCyclo{Dir: dir, Filenames: filenames}, check.License{Dir: dir, Filenames: []string{}}, + check.Errcheck{Dir: dir, Filenames: filenames}, check.Misspell{Dir: dir, Filenames: filenames}, check.IneffAssign{Dir: dir, Filenames: filenames}, }