MCPcopy Create free account
hub / github.com/google/git-appraise / ParseAllValid

Function ParseAllValid

review/comment/comment.go:149–161  ·  view source on GitHub ↗

ParseAllValid takes collection of git notes and tries to parse a review comment from each one. Any notes that are not valid review comments get ignored, as we expect the git notes to be a heterogenous list, with only some of them being review comments.

(notes []repository.Note)

Source from the content-addressed store, hash-verified

147// ignored, as we expect the git notes to be a heterogenous list, with only
148// some of them being review comments.
149func ParseAllValid(notes []repository.Note) map[string]Comment {
150 comments := make(map[string]Comment)
151 for _, note := range notes {
152 comment, err := Parse(note)
153 if err == nil && comment.Version == FormatVersion {
154 hash, err := comment.Hash()
155 if err == nil {
156 comments[hash] = comment
157 }
158 }
159 }
160 return comments
161}
162
163func (comment Comment) serialize() ([]byte, error) {
164 if len(comment.Timestamp) < 10 {

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.70
HashMethod · 0.45

Tested by

no test coverage detected