X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=runtime%2Fsyntax%2Fsyntax_checker.go;h=5b8da244b1deb9764dd739b7c44dc91b0dc77386;hb=54c23cae72d7237bc898a59f79aad0acffdf0ffe;hp=7454371f824d15902063977bc4b7a230ea0f9a09;hpb=8a33c98bc60457dba4fe9eb25a712a5a18f7877a;p=micro.git diff --git a/runtime/syntax/syntax_checker.go b/runtime/syntax/syntax_checker.go index 7454371f..5b8da244 100644 --- a/runtime/syntax/syntax_checker.go +++ b/runtime/syntax/syntax_checker.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "strings" - "github.com/zyedidia/micro/cmd/micro/highlight" + "github.com/zyedidia/highlight" ) func main() { @@ -15,16 +15,24 @@ func main() { for _, f := range files { if strings.HasSuffix(f.Name(), ".yaml") { input, _ := ioutil.ReadFile(f.Name()) - _, err := highlight.ParseDef(input) + //fmt.Println("Checking file -> ", f.Name()) + file, err := highlight.ParseFile(input) if err != nil { hadErr = true - fmt.Printf("%s:\n", f.Name()) + fmt.Printf("Could not parse file -> %s:\n", f.Name()) fmt.Println(err) continue } + _, err1 := highlight.ParseDef(file, nil) + if err1 != nil { + hadErr = true + fmt.Printf("Could not parse input file using highlight.ParseDef(%s):\n", f.Name()) + fmt.Println(err1) + continue + } } } if !hadErr { - fmt.Println("No issues!") + fmt.Println("No issues found!") } }