Skip to content

Commit

Permalink
Fix: output format
Browse files Browse the repository at this point in the history
Output format is strange so format it.

close #3
  • Loading branch information
aimof committed Mar 30, 2019
1 parent 7cb273e commit a5203de
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmd/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"io"
"os"
"strings"
"sort"

"github.com/moby/buildkit/frontend/dockerfile/parser"
"github.com/zabio3/godolint/linter"
Expand Down Expand Up @@ -107,6 +107,12 @@ func (cli *CLI) Run(args []string) int {
return ExitCodeLintCheckError
}

_, _ = fmt.Fprint(cli.OutStream, strings.Trim(fmt.Sprintf("%s", rst), "[]"))
rst = sort.StringSlice(rst)
var output string
for _, s := range rst {
// ends of each strings have "\n"
output = output + s
}
_, _ = fmt.Fprint(cli.OutStream, output)
return ExitCodeOK
}

0 comments on commit a5203de

Please sign in to comment.