Skip to content

Commit

Permalink
Merge pull request #163 from marquiz/devel/validate-fix
Browse files Browse the repository at this point in the history
cmd/validate: print the validation errors
  • Loading branch information
elezar authored Sep 27, 2023
2 parents 1ed1694 + 1078daf commit f161fa4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/cdi/cmd/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package cmd
import (
"fmt"
"os"
"strings"

"github.com/spf13/cobra"

Expand All @@ -40,6 +41,13 @@ were reported by the registry.`,
return
}

fmt.Printf("CDI Registry has errors:\n")
for path, specErrors := range cdiErrors {
fmt.Printf("Spec file %s:\n", path)
for idx, err := range specErrors {
fmt.Printf(" %2d: %v\n", idx, strings.TrimSpace(err.Error()))
}
}
os.Exit(1)
},
}
Expand Down

0 comments on commit f161fa4

Please sign in to comment.