mirror of
https://github.com/moby/buildkit.git
synced 2026-08-12 22:16:54 +00:00
Merge pull request #5045 from daghack/detail-not-description
Updates lint output to print detail instead of description
This commit is contained in:
@@ -91,8 +91,12 @@ func (rule *LinterRule[F]) Run(warn LintWarnFunc, location []parser.Range, txt .
|
||||
warn(rule.Name, rule.Description, rule.URL, short, location)
|
||||
}
|
||||
|
||||
func LintFormatShort(rulename, msg string, startLine int) string {
|
||||
return fmt.Sprintf("%s: %s (line %d)", rulename, msg, startLine)
|
||||
func LintFormatShort(rulename, msg string, line int) string {
|
||||
msg = fmt.Sprintf("%s: %s", rulename, msg)
|
||||
if line > 0 {
|
||||
msg = fmt.Sprintf("%s (line %d)", msg, line)
|
||||
}
|
||||
return msg
|
||||
}
|
||||
|
||||
type LintWarnFunc func(rulename, description, url, fmtmsg string, location []parser.Range)
|
||||
|
||||
@@ -173,7 +173,7 @@ func PrintLintViolations(dt []byte, w io.Writer) error {
|
||||
if warning.URL != "" {
|
||||
fmt.Fprintf(w, " - %s", warning.URL)
|
||||
}
|
||||
fmt.Fprintf(w, "\n%s\n", warning.Description)
|
||||
fmt.Fprintf(w, "\n%s\n", warning.Detail)
|
||||
|
||||
if warning.Location.SourceIndex < 0 {
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user