diff --git a/assets/goreportcard.css b/assets/goreportcard.css index 0e28379..ef89d03 100644 --- a/assets/goreportcard.css +++ b/assets/goreportcard.css @@ -97,6 +97,11 @@ margin-top: 1em; font-weight: 600; } +.results-details .error-msg { + margin-top: 1em; + font-weight: 600; + color: #C6761E; +} #badge_dropdown { position: absolute; top: 40px; diff --git a/check/errcheck.go b/check/errcheck.go index b3cf0c0..0f0ef4d 100644 --- a/check/errcheck.go +++ b/check/errcheck.go @@ -18,7 +18,7 @@ func (c ErrCheck) Weight() float64 { // 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"}) + return GoTool(c.Dir, c.Filenames, []string{"gometalinter", "--deadline=180s", "--disable-all", "--linter='errch:errcheck {path}:PATH:LINE:MESSAGE'", "--enable=errch"}) } // Description returns the description of gofmt diff --git a/handlers/checks.go b/handlers/checks.go index e2d73b7..2d2a735 100644 --- a/handlers/checks.go +++ b/handlers/checks.go @@ -67,6 +67,7 @@ type score struct { FileSummaries []check.FileSummary `json:"file_summaries"` Weight float64 `json:"weight"` Percentage float64 `json:"percentage"` + Error string `json:"error"` } type checksResp struct { @@ -185,15 +186,17 @@ func newChecksResp(repo string, forceRefresh bool) (checksResp, error) { check.License{Dir: dir, Filenames: []string{}}, check.Misspell{Dir: dir, Filenames: filenames}, check.IneffAssign{Dir: dir, Filenames: filenames}, - check.ErrCheck{Dir: dir, Filenames: filenames}, + // check.ErrCheck{Dir: dir, Filenames: filenames}, // disable errcheck for now, too slow and not finalized } ch := make(chan score) for _, c := range checks { go func(c check.Check) { p, summaries, err := c.Percentage() + errMsg := "" if err != nil { log.Printf("ERROR: (%s) %v", c.Name(), err) + errMsg = err.Error() } s := score{ Name: c.Name(), @@ -201,6 +204,7 @@ func newChecksResp(repo string, forceRefresh bool) (checksResp, error) { FileSummaries: summaries, Weight: c.Weight(), Percentage: p, + Error: errMsg, } ch <- s }(c) diff --git a/templates/report.html b/templates/report.html index c3d0102..93c2b38 100644 --- a/templates/report.html +++ b/templates/report.html @@ -149,23 +149,27 @@
{{{description}}}
- {{^file_summaries}} -No problems detected. Good job!
- {{/file_summaries}} - {{#each file_summaries}} -An error occurred while running this test ({{error}})
+ {{else}} + {{^file_summaries}} +No problems detected. Good job!
+ {{/file_summaries}} + {{#each file_summaries}} +