vendor: update buildkit to 8397d0b9

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2024-06-27 20:24:41 -07:00
parent 04000db8da
commit af902caeaa
7 changed files with 45 additions and 9 deletions

View File

@ -39,7 +39,7 @@ func New(config *Config) *Linter {
}
func (lc *Linter) Run(rule LinterRuleI, location []parser.Range, txt ...string) {
if lc == nil || lc.Warn == nil || lc.SkipAll {
if lc == nil || lc.Warn == nil || lc.SkipAll || rule.IsDeprecated() {
return
}
rulename := rule.RuleName()
@ -71,11 +71,13 @@ func (lc *Linter) Error() error {
type LinterRuleI interface {
RuleName() string
Run(warn LintWarnFunc, location []parser.Range, txt ...string)
IsDeprecated() bool
}
type LinterRule[F any] struct {
Name string
Description string
Deprecated bool
URL string
Format F
}
@ -92,6 +94,10 @@ func (rule *LinterRule[F]) Run(warn LintWarnFunc, location []parser.Range, txt .
warn(rule.Name, rule.Description, rule.URL, short, location)
}
func (rule *LinterRule[F]) IsDeprecated() bool {
return rule.Deprecated
}
func LintFormatShort(rulename, msg string, line int) string {
msg = fmt.Sprintf("%s: %s", rulename, msg)
if line > 0 {