Documentation ¶
Overview ¶
Package standard contains a todo matcher & comments matcher for standard C-like comments. C-like comments use the // literal for single-line comments & /* */ for multi-line comments.
Index ¶
- type CommentMatcher
- func (m *CommentMatcher) MultiLineCommentState(filename, line string, linecnt int, prevToken, currToken, nextToken rune) (state.CommentState, error)
- func (m *CommentMatcher) NonCommentState(filename, line string, linecnt int, prevToken, currToken, nextToken rune) (state.CommentState, error)
- func (m *CommentMatcher) SingleLineCommentState(filename, line string, linecnt int, prevToken, currToken, nextToken rune) (state.CommentState, error)
- func (m *CommentMatcher) StringState(filename, line string, linecnt int, prevToken, currToken, nextToken rune) (state.CommentState, error)
- type TodoMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommentMatcher ¶
type CommentMatcher struct {
// contains filtered or unexported fields
}
CommentMatcher for standard comments
func NewCommentMatcher ¶
func NewCommentMatcher(callback state.CommentCallback, hasNestedMultilineComments bool) *CommentMatcher
NewCommentMatcher for standard comments
func (*CommentMatcher) MultiLineCommentState ¶
func (m *CommentMatcher) MultiLineCommentState( filename, line string, linecnt int, prevToken, currToken, nextToken rune, ) (state.CommentState, error)
MultiLineCommentState for standard comments
func (*CommentMatcher) NonCommentState ¶
func (m *CommentMatcher) NonCommentState( filename, line string, linecnt int, prevToken, currToken, nextToken rune, ) (state.CommentState, error)
NonCommentState for standard comments
func (*CommentMatcher) SingleLineCommentState ¶
func (m *CommentMatcher) SingleLineCommentState( filename, line string, linecnt int, prevToken, currToken, nextToken rune, ) (state.CommentState, error)
SingleLineCommentState for standard comments
func (*CommentMatcher) StringState ¶
func (m *CommentMatcher) StringState( filename, line string, linecnt int, prevToken, currToken, nextToken rune, ) (state.CommentState, error)
StringState for standard comments
type TodoMatcher ¶
type TodoMatcher struct {
// contains filtered or unexported fields
}
TodoMatcher for standard comments
func NewTodoMatcher ¶
func NewTodoMatcher(todos []string) *TodoMatcher
NewTodoMatcher for standard comments
func (*TodoMatcher) ExtractIssueRef ¶
func (m *TodoMatcher) ExtractIssueRef(expr string) (string, error)
ExtractIssueRef from the given expression. If the expression is invalid, an ErrInvalidTODO is returned
func (*TodoMatcher) IsMatch ¶
func (m *TodoMatcher) IsMatch(expr string) bool
IsMatch checks if the current expression matches a standard comment
func (*TodoMatcher) IsValid ¶
func (m *TodoMatcher) IsValid(expr string) bool
IsValid checks if the expression is a valid todo comment