Skip to content

Commit

Permalink
Make LintedTotal available in custom template
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmckenzie committed Nov 16, 2020
1 parent ecb011a commit 0f63e57
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ui/custom.go
Expand Up @@ -21,7 +21,8 @@ type ProcessedFile struct {

// Data holds the information exposed to UI templates.
type Data struct {
Files []ProcessedFile
Files []ProcessedFile
LintedTotal int
}

var funcs = sprig.TxtFuncMap()
Expand Down Expand Up @@ -91,6 +92,7 @@ func PrintCustomAlerts(linted []*core.File, path string) (bool, error) {
}

return alertCount != 0, t.Execute(os.Stdout, Data{
Files: formatted,
Files: formatted,
LintedTotal: len(linted),
})
}

0 comments on commit 0f63e57

Please sign in to comment.