Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ linters:
exclude-functions:
- github.com/open-policy-agent/opa/v1/util.WriteAppender
- github.com/open-policy-agent/opa/v1/util.WriteInt
- (io.Writer).Write
forbidigo:
forbid:
- pattern: '^sort\.[A-Z][a-zA-Z]+$'
Expand Down
3 changes: 2 additions & 1 deletion cmd/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ func parse(args []string, params *parseParams, stdout io.Writer, stderr io.Write
_ = pr.JSON(stderr, pr.Output{Errors: pr.NewOutputErrors(err)})
return 1
}
_, _ = stdout.Write(append(bs, '\n'))

stdout.Write(append(bs, '\n'))
default:
ast.Pretty(stdout, result.Parsed)
}
Expand Down
12 changes: 5 additions & 7 deletions internal/presentation/presentation.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func (o DepAnalysisOutput) JSON(w io.Writer) error {

// Pretty outputs o to w in a human-readable format.
func (o DepAnalysisOutput) Pretty(w io.Writer) error {

var headers []string
var rows [][]string

Expand Down Expand Up @@ -374,7 +373,7 @@ func Source(w io.Writer, errW io.Writer, r Output) error {
if err != nil {
return err
}
fmt.Fprintln(w, string(bs))
w.Write(append(bs, '\n'))
}

for i := range r.Partial.Support {
Expand All @@ -383,7 +382,7 @@ func Source(w io.Writer, errW io.Writer, r Output) error {
if err != nil {
return err
}
fmt.Fprint(w, string(bs))
w.Write(bs)
}

return nil
Expand All @@ -407,14 +406,13 @@ func Raw(w io.Writer, errW io.Writer, r Output) error {
if err != nil {
return err
}

fmt.Fprint(w, string(bytes))
w.Write(bytes)
}

if i+1 >= len(rs.Expressions) {
fmt.Fprintln(w, "")
w.Write([]byte{'\n'})
} else {
fmt.Fprint(w, " ")
w.Write([]byte{' '})
}
}
}
Expand Down
Loading