Documentation ¶
Index ¶
- Constants
- Variables
- func PrintIssueDetails(issues []Issue, keyStyle, valStyle lipgloss.Style)
- type CommentManager
- type CommentNotation
- type Issue
- type IssueManager
- type NewCommentManagerParams
- type PendingIssue
- type ProcessedIssue
- type SingleLineComment
- func (slc *SingleLineComment) FindCutLocations(line []byte) ([]int, error)
- func (slc *SingleLineComment) FindSuffixLocations(line []byte) []int
- func (slc *SingleLineComment) NewIssue(buf *bytes.Buffer, lineNumber int) *Issue
- func (slc *SingleLineComment) ParseComment(start int) ([]Issue, error)
- func (slc *SingleLineComment) Slice(line []byte, indices []int) ([]byte, error)
- func (slc *SingleLineComment) Write(wr io.Writer, field []byte) (int, error)
Constants ¶
View Source
const ( PENDING_ISSUE = "pending" PROCESSED_ISSUE = "processed" )
View Source
const ( SINGLE_LINE_COMMENT = "s" MULTI_LINE_COMMENT = "m" )
Variables ¶
View Source
var CommentNotations = map[string]CommentNotation{ "default": { SingleLinePrefixRe: regexp.MustCompile(`#`), }, // contains filtered or unexported fields }
Functions ¶
func PrintIssueDetails ¶ added in v0.8.5
Types ¶
type CommentManager ¶ added in v0.8.5
func NewCommentManager ¶ added in v0.8.5
func NewCommentManager(arg NewCommentManagerParams) (CommentManager, error)
type CommentNotation ¶
type CommentNotation struct { SingleLinePrefixRe *regexp.Regexp SingleLineSuffixRe *regexp.Regexp MultiLinePrefixRe *regexp.Regexp MultiLineSuffixRe *regexp.Regexp NewLinePrefixRe *regexp.Regexp }
func NewCommentNotation ¶
func NewCommentNotation(ext string) CommentNotation
func (*CommentNotation) FindPrefixLocations ¶ added in v0.8.5
func (cn *CommentNotation) FindPrefixLocations(line []byte) ([]int, string)
type IssueManager ¶
type IssueManager interface { GetIssues() []Issue Scan(r io.Reader, path string) error Walk(root string, ignore []regexp.Regexp) (int, error) }
func NewIssueManager ¶
func NewIssueManager(issueType string, annotation string) (IssueManager, error)
NewIssueManager will return either a PendingIssue struct or ProcessedIssue struct that satisfies the methods defined in the IssueManager interface. The methods in said interface are used to report new issues an SCM or locate issues that have been reported to an SCM. Each struct will implement methods for walking the project directory and parsing source code files. The main difference is that pending issues will have an annotation with no id, since they haven't been pushed to an scm yet, and processed issues will have their original annotation plus an id so they can be located and removed from the source code file at a later time.
type NewCommentManagerParams ¶ added in v0.8.5
type PendingIssue ¶
func (*PendingIssue) GetIssues ¶
func (pi *PendingIssue) GetIssues() []Issue
type ProcessedIssue ¶
func (*ProcessedIssue) GetIssues ¶
func (pi *ProcessedIssue) GetIssues() []Issue
type SingleLineComment ¶ added in v0.8.5
type SingleLineComment struct { Annotation string AnnotationIndicator bool FileName string FilePath string PrefixRe *regexp.Regexp SuffixRe *regexp.Regexp Scanner *bufio.Scanner CommentNotationLocations []int }
func (*SingleLineComment) FindCutLocations ¶ added in v0.8.5
func (slc *SingleLineComment) FindCutLocations(line []byte) ([]int, error)
func (*SingleLineComment) FindSuffixLocations ¶ added in v0.8.5
func (slc *SingleLineComment) FindSuffixLocations(line []byte) []int
func (*SingleLineComment) NewIssue ¶ added in v0.8.5
func (slc *SingleLineComment) NewIssue(buf *bytes.Buffer, lineNumber int) *Issue
func (*SingleLineComment) ParseComment ¶ added in v0.8.5
func (slc *SingleLineComment) ParseComment(start int) ([]Issue, error)
Click to show internal directories.
Click to hide internal directories.