Skip to content

Commit

Permalink
only print the top 10 authors, including scores less than 0
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdevivo committed Apr 23, 2020
1 parent 29e2325 commit b76fd7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ var rootCmd = &cobra.Command{
fmt.Fprintf(w, "Rank\tEmail\tName\tScore\tImpact\tCommits\n")
for rank, authorEmail := range authorEmails {
agg := authors[authorEmail]
// ignore scores less than 0
if agg.score < 1 {
continue
// only print the top 10
if rank > 9 {
break
}
fmt.Fprintf(w, "%d\t%s\t%s\t%d\t%d\t%d\n", rank+1, authorEmail, agg.name, int(math.Round(agg.score)), agg.impact, agg.commits)
}
Expand Down

0 comments on commit b76fd7d

Please sign in to comment.