Skip to content

Commit a1b0822

Browse files
committed
handle TODO and TODO: format
1 parent 313d4ce commit a1b0822

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pkg/todos/report.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
// DefaultTemplate is the default report template
99
const DefaultTemplate = `
1010
{{- range $index, $todo := . }}
11-
{{ print "\u001b[33m" }}TODO{{ print "\u001b[0m" }}{{ .String }}
11+
{{ print "\u001b[33m" }}TODO{{ print "\u001b[0m" }}: {{ .String }}
1212
=> {{ with .Comment }}{{ .FilePath }}:{{ .StartLocation.Line }}:{{ .StartLocation.Pos }}{{ end }}
1313
{{ else }}
1414
no todos 🎉

pkg/todos/todos.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package todos
22

33
import (
4+
"regexp"
45
"strings"
56

67
"github.com/augmentable-dev/tickgit/pkg/comments"
@@ -26,7 +27,8 @@ func NewToDo(comment comments.Comment) *ToDo {
2627
if !strings.Contains(s, "TODO") {
2728
return nil
2829
}
29-
s = strings.Replace(comment.String(), "TODO", "", 1)
30+
re := regexp.MustCompile(`TODO:?`)
31+
s = re.ReplaceAllLiteralString(comment.String(), "")
3032
s = strings.Trim(s, " ")
3133

3234
todo := ToDo{Comment: comment, String: s}

0 commit comments

Comments
 (0)