()
| 53 | func (n NoteEvent) CreatedAt() time.Time { return *n.Note.CreatedAt } |
| 54 | |
| 55 | func (n NoteEvent) Kind() EventKind { |
| 56 | if _, err := parser.NewWithInput(parser.TitleParser, n.Body).Parse(); err == nil { |
| 57 | return EventTitleChanged |
| 58 | } |
| 59 | |
| 60 | switch { |
| 61 | case !n.System: |
| 62 | return EventComment |
| 63 | |
| 64 | case n.Body == "closed": |
| 65 | return EventClosed |
| 66 | |
| 67 | case n.Body == "reopened": |
| 68 | return EventReopened |
| 69 | |
| 70 | case n.Body == "changed the description": |
| 71 | return EventDescriptionChanged |
| 72 | |
| 73 | case n.Body == "locked this issue": |
| 74 | return EventLocked |
| 75 | |
| 76 | case n.Body == "unlocked this issue": |
| 77 | return EventUnlocked |
| 78 | |
| 79 | case strings.HasPrefix(n.Body, "changed due date to"): |
| 80 | return EventChangedDuedate |
| 81 | |
| 82 | case n.Body == "removed due date": |
| 83 | return EventRemovedDuedate |
| 84 | |
| 85 | case strings.HasPrefix(n.Body, "assigned to @"): |
| 86 | return EventAssigned |
| 87 | |
| 88 | case strings.HasPrefix(n.Body, "unassigned @"): |
| 89 | return EventUnassigned |
| 90 | |
| 91 | case strings.HasPrefix(n.Body, "changed milestone to %"): |
| 92 | return EventChangedMilestone |
| 93 | |
| 94 | case strings.HasPrefix(n.Body, "removed milestone"): |
| 95 | return EventRemovedMilestone |
| 96 | |
| 97 | case strings.HasPrefix(n.Body, "mentioned in issue"): |
| 98 | return EventMentionedInIssue |
| 99 | |
| 100 | case strings.HasPrefix(n.Body, "mentioned in merge request"): |
| 101 | return EventMentionedInMergeRequest |
| 102 | |
| 103 | case strings.HasPrefix(n.Body, "mentioned in commit"): |
| 104 | return EventMentionedInCommit |
| 105 | |
| 106 | default: |
| 107 | return EventUnknown |
| 108 | } |
| 109 | |
| 110 | } |
| 111 | |
| 112 | func (n NoteEvent) Title() (string, error) { |
no test coverage detected