Skip to content

Commit f161fa4

Browse files
authored
Merge pull request #163 from marquiz/devel/validate-fix
cmd/validate: print the validation errors
2 parents 1ed1694 + 1078daf commit f161fa4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmd/cdi/cmd/validate.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package cmd
1919
import (
2020
"fmt"
2121
"os"
22+
"strings"
2223

2324
"github.com/spf13/cobra"
2425

@@ -40,6 +41,13 @@ were reported by the registry.`,
4041
return
4142
}
4243

44+
fmt.Printf("CDI Registry has errors:\n")
45+
for path, specErrors := range cdiErrors {
46+
fmt.Printf("Spec file %s:\n", path)
47+
for idx, err := range specErrors {
48+
fmt.Printf(" %2d: %v\n", idx, strings.TrimSpace(err.Error()))
49+
}
50+
}
4351
os.Exit(1)
4452
},
4553
}

0 commit comments

Comments
 (0)