Skip to content

Commit

Permalink
Merge pull request #270 from ashmckenzie/ashmckenzie/include-lined-to…
Browse files Browse the repository at this point in the history
…tal-count

fix: make LintedTotal available in custom template
  • Loading branch information
jdkato committed Nov 16, 2020
2 parents ecb011a + 0f63e57 commit e2f4984
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 e2f4984

Please sign in to comment.