Skip to content

Commit

Permalink
add parseIssues function (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
takashi committed Apr 24, 2014
1 parent 9e74a3b commit c9dc83f
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions parser.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package main

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"regexp"
)

func ParseFiles(dir string) error {
Expand All @@ -26,8 +29,23 @@ func WalkFn(path string, info os.FileInfo, err error) error {
} else if info.IsDir() {
// do nothing
} else {
// do the file parse here
println(info.Name())
ParseIssues(path string, info os.FileInfo)
}
return nil
}

func ParseIssues() {
// do the file parse here
lang := DetectLangFromExt(filepath.Ext(path))
if lang != nil {
body, err := ioutil.ReadFile(path)
if err != nil {
return err
}
re, _ := regexp.Compile(`# \[TODO\].*`)
one := re.Find(body)
if one != nil {
fmt.Printf("Find a TODO: %s \n at %s\n", one, path)
}
}
}

0 comments on commit c9dc83f

Please sign in to comment.