Reformat linting errors in LintForErrors

See toolshed/organising#497 (comment)
This commit is contained in:
3wc
2025-08-12 13:08:18 +01:00
committed by 3wordchant
parent c63f6db61e
commit 0ab05cece2

View File

@ -201,13 +201,13 @@ func LintForErrors(recipe recipe.Recipe) error {
errors += fmt.Sprintf("\nlint %s: %s", rule.Ref, err)
}
if !ok {
errors += fmt.Sprintf("\nlint error in %s configs: \"%s\" failed lint checks (%s)", recipe.Name, rule.Description, rule.Ref)
errors += fmt.Sprintf("\n * %s (%s)", rule.Description, rule.Ref)
}
}
}
if (len(errors) > 0) {
return fmt.Errorf(errors[1:])
return fmt.Errorf("recipe '%s' failed lint checks:\n" + errors[1:], recipe.Name)
}
log.Debugf("linting successful, %s is well configured", recipe.Name)