This commit is contained in:
Samuel Hawksby-Robinson 2021-01-05 14:44:31 +00:00
parent 455b5565d8
commit 2e275015c3
No known key found for this signature in database
GPG Key ID: 64CF99D4A64A1205
2 changed files with 13 additions and 13 deletions

View File

@ -5,12 +5,12 @@ import (
)
type entityTracker struct {
entityDetector *regexp.Regexp
openBracketDetector *regexp.Regexp
entityDetector *regexp.Regexp
openBracketDetector *regexp.Regexp
closeBracketDetector *regexp.Regexp
currentEntity string
lastEntity string
lastEntity string
openBracketCount map[string]int
}
@ -31,10 +31,10 @@ func NewEntityTracker() (*entityTracker, error) {
}
return &entityTracker{
entityDetector: ed,
openBracketDetector: obd,
entityDetector: ed,
openBracketDetector: obd,
closeBracketDetector: cbd,
openBracketCount: map[string]int{},
openBracketCount: map[string]int{},
}, nil
}

14
main.go
View File

@ -16,21 +16,21 @@ import (
const (
statusDir = "../status-go"
ignore = statusDir + "/vendor"
ignore = statusDir + "/vendor"
)
var (
keywords = []string{"todo", "fixme"}
found []todo
found []todo
// todoMode tracks if subsequent comment lines should be included in the last to-do's description
todoMode = false
)
type todo struct {
Filepath string
Description string
LineNumber int
Filepath string
Description string
LineNumber int
RelatedFuncOrType string
}
@ -78,7 +78,7 @@ func processFilesInDir(dir string) error {
}
}
if !isGoFile(f.Name()){
if !isGoFile(f.Name()) {
continue
}
@ -108,7 +108,7 @@ func processFilesInDir(dir string) error {
continue
}
found = append(found, todo{filepath, string(results[1]), i+1, et.Current()})
found = append(found, todo{filepath, string(results[1]), i + 1, et.Current()})
todoMode = true
}
}