Skip to content

Commit 15eec79

Browse files
authored
Merge pull request moby#5037 from daghack/label-lint-warnings
Adds 'WARNING' prefix to the rule check output
2 parents 5642608 + 09dafda commit 15eec79

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

frontend/subrequests/lint/lint.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func (results *LintResults) ToResult() (*client.Result, error) {
108108
res.AddMeta("result.txt", b.Bytes())
109109

110110
status := 0
111-
if len(results.Warnings) > 0 {
111+
if len(results.Warnings) > 0 || results.Error != nil {
112112
status = 1
113113
}
114114
res.AddMeta("result.statuscode", []byte(fmt.Sprintf("%d", status)))
@@ -169,7 +169,7 @@ func PrintLintViolations(dt []byte, w io.Writer) error {
169169
})
170170

171171
for _, warning := range results.Warnings {
172-
fmt.Fprintf(w, "%s", warning.RuleName)
172+
fmt.Fprintf(w, "\nWARNING: %s", warning.RuleName)
173173
if warning.URL != "" {
174174
fmt.Fprintf(w, " - %s", warning.URL)
175175
}
@@ -187,8 +187,8 @@ func PrintLintViolations(dt []byte, w io.Writer) error {
187187
if err != nil {
188188
return err
189189
}
190-
fmt.Fprintln(w)
191190
}
191+
192192
return nil
193193
}
194194

0 commit comments

Comments
 (0)