Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTypes = []string{
"TODO",
"Todo",
"todo",
"FIXME",
"Fixme",
"fixme",
"BUG",
"Bug",
"bug",
"HACK",
"Hack",
"hack",
"XXX",
"COMBAK",
}
DefaultTypes is the default set of TODO types.
Functions ¶
This section is empty.
Types ¶
type CommentScanner ¶ added in v0.1.0
type CommentScanner interface { // Config return the configuration. Config() *scanner.Config // Scan scans for the next comment. It returns true if there is more data // to scan. Scan() bool // Next returns the next Comment. Next() *scanner.Comment // Err returns an error if one occurred. Err() error }
CommentScanner is a type that scans code text for comments.
type Config ¶ added in v0.1.0
type Config struct {
Types []string
}
Config is configuration for the TODOScanner.
type TODO ¶
type TODO struct { // Type is the todo type, such as "FIXME", "BUG", etc. Type string // Text is the full text of the TODO. For single line comments this is the // whole comment. For multi-line comments this is the line where the TODO // appears. Text string // Label is the label part (the part in parenthesis) Label string // Message is the comment message (the part after the parenthesis). Message string // Line is the line number where todo was found.. Line int // CommentLine is the line where the comment starts. CommentLine int }
TODO is a todo comment.
type TODOScanner ¶
type TODOScanner struct {
// contains filtered or unexported fields
}
TODOScanner scans for TODO comments.
func NewTODOScanner ¶
func NewTODOScanner(s CommentScanner, config *Config) *TODOScanner
NewTODOScanner returns a new TODOScanner.
func (*TODOScanner) Err ¶
func (t *TODOScanner) Err() error
Err returns the first error encountered.
Click to show internal directories.
Click to hide internal directories.