Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcknowledgementExcerpt ¶
func AcknowledgementExcerpt(content []byte, comment SourceComment) (string, error)
AcknowledgementExcerpt selects a unique anchor that contains the retained comment.
func IsCommentIntent ¶
func IsCommentIntent(comment SourceComment) bool
IsCommentIntent distinguishes prose from text that parses as Go statements.
Types ¶
type Conversion ¶
Conversion is the source edit and deterministic code anchor for comment intent.
func Convert ¶
func Convert(content []byte, comment SourceComment) (Conversion, error)
Convert removes one comment and selects nearby code as its annotation anchor.
type SourceComment ¶
SourceComment is an exact syntactic comment group in one source file.
type Violation ¶
type Violation struct {
Comment SourceComment
Reason string
}
Violation is a prohibited comment and the action that resolves it.
func Check ¶
func Check(rootPath string, configured policy.Policy, requested []string) (_ []Violation, returnedError error)
Check scans supported source and returns every prohibited comment.
func CheckContent ¶
func CheckContent(file string, content []byte, configured policy.Policy, records []store.Annotation) ([]Violation, error)
CheckContent applies comment policy to an in-memory source document.