todos

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

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.

func (*TODOScanner) Next

func (t *TODOScanner) Next() *TODO

Next returns the next TODO.

func (*TODOScanner) Scan

func (t *TODOScanner) Scan() bool

Scan scans for the next TODO.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL