mirror of
https://github.com/moby/buildkit.git
synced 2026-11-06 05:16:45 +00:00
add SourceInfoMap callback to LintResults.PrintErrorTo params
Signed-off-by: Talon Bowler <talon.bowler@docker.com>
This commit is contained in:
1 parent
94d3daefd5
commit
c07508603c
1 file changed
+4
-1
@@ -180,7 +180,7 @@ func (results *LintResults) PrintTo(w io.Writer, scb SourceInfoMap) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (results *LintResults) PrintErrorTo(w io.Writer) {
|
||||
func (results *LintResults) PrintErrorTo(w io.Writer, scb SourceInfoMap) {
|
||||
// This prints out the error in LintResults to the writer in a format that
|
||||
// is consistent with the warnings for easier downstream consumption.
|
||||
if results.Error == nil {
|
||||
@@ -189,6 +189,9 @@ func (results *LintResults) PrintErrorTo(w io.Writer) {
|
||||
|
||||
fmt.Fprintln(w, results.Error.Message)
|
||||
sourceInfo := results.Sources[results.Error.Location.SourceIndex]
|
||||
if scb != nil {
|
||||
sourceInfo = scb(sourceInfo)
|
||||
}
|
||||
source := errdefs.Source{
|
||||
Info: sourceInfo,
|
||||
Ranges: results.Error.Location.Ranges,
|
||||
|
||||
Reference in new issue
Block a user