Documentation ¶
Overview ¶
Package scripts contains a todo matcher & comments matcher for scripts. Scripts contain only single-line comments which begin with '#'
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 scripts comments
func NewCommentMatcher ¶
func NewCommentMatcher(callback state.CommentCallback) *CommentMatcher
NewCommentMatcher for scripts comments
func (*CommentMatcher) MultiLineCommentState ¶
func (m *CommentMatcher) MultiLineCommentState( filename, line string, linecnt int, prevToken, currToken, nextToken rune, ) (state.CommentState, error)
MultiLineCommentState for scripts comments
func (*CommentMatcher) NonCommentState ¶
func (m *CommentMatcher) NonCommentState( filename, line string, linecnt int, prevToken, currToken, nextToken rune, ) (state.CommentState, error)
NonCommentState for scripts comments
func (*CommentMatcher) SingleLineCommentState ¶
func (m *CommentMatcher) SingleLineCommentState( filename, line string, linecnt int, prevToken, currToken, nextToken rune, ) (state.CommentState, error)
SingleLineCommentState for scripts comments
func (*CommentMatcher) StringState ¶
func (m *CommentMatcher) StringState( filename, line string, linecnt int, prevToken, currToken, nextToken rune, ) (state.CommentState, error)
StringState for scripts comments
type TodoMatcher ¶
type TodoMatcher struct {
// contains filtered or unexported fields
}
TodoMatcher for scripts comments
func NewTodoMatcher ¶
func NewTodoMatcher(todos []string) *TodoMatcher
NewTodoMatcher for scripts 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