Skip to content

Commit

Permalink
design: update emojis used (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
jazanne authored Aug 3, 2023
1 parent df205fc commit d022b58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions comments/comments.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ func BuildFlagComment(buildComment FlagComments, flagsRef lflags.FlagsRef, exist

numFlagsAdded := len(flagsRef.FlagsAdded)
if numFlagsAdded > 0 {
commentStr = append(commentStr, fmt.Sprintf("### :green_circle: %s added or modified\n", pluralize("flag reference", numFlagsAdded)))
commentStr = append(commentStr, fmt.Sprintf("### :mag: %s added or modified\n", pluralize("flag reference", numFlagsAdded)))
commentStr = append(commentStr, tableHeader)
commentStr = append(commentStr, buildComment.CommentsAdded...)
commentStr = append(commentStr, "\n")
}

numFlagsRemoved := len(flagsRef.FlagsRemoved)
if numFlagsRemoved > 0 {
commentStr = append(commentStr, fmt.Sprintf("### :red_circle: %s removed\n", pluralize("flag reference", numFlagsRemoved)))
commentStr = append(commentStr, fmt.Sprintf("### :x: %s removed\n", pluralize("flag reference", numFlagsRemoved)))
commentStr = append(commentStr, tableHeader)
commentStr = append(commentStr, buildComment.CommentsRemoved...)
}
Expand Down
6 changes: 3 additions & 3 deletions comments/comments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (e *testCommentBuilder) AddedOnly(t *testing.T) {
e.Comments.CommentsAdded = []string{"comment1", "comment2"}
comment := BuildFlagComment(e.Comments, e.FlagsRef, nil)

expected := "## LaunchDarkly flag references\n### :green_circle: 1 flag reference added or modified\n\n| Name | Key | Aliases found |\n| --- | --- | --- |\ncomment1\ncomment2\n\n\n <!-- flags:example-flag -->\n <!-- comment hash: 77f715c4d3584af227af5d5e661aad5e -->"
expected := "## LaunchDarkly flag references\n### :mag: 1 flag reference added or modified\n\n| Name | Key | Aliases found |\n| --- | --- | --- |\ncomment1\ncomment2\n\n\n <!-- flags:example-flag -->\n <!-- comment hash: 98132cdd9e1dd632faf0c76e28a4bed1 -->"
assert.Equal(t, expected, comment)
}

Expand All @@ -186,7 +186,7 @@ func (e *testCommentBuilder) RemovedOnly(t *testing.T) {
e.Comments.CommentsRemoved = []string{"comment1", "comment2"}
comment := BuildFlagComment(e.Comments, e.FlagsRef, nil)

expected := "## LaunchDarkly flag references\n### :red_circle: 2 flag references removed\n\n| Name | Key | Aliases found |\n| --- | --- | --- |\ncomment1\ncomment2\n <!-- flags:example-flag,sample-flag -->\n <!-- comment hash: 10e2cf9d20d151dd33a99dfde7f8ec5b -->"
expected := "## LaunchDarkly flag references\n### :x: 2 flag references removed\n\n| Name | Key | Aliases found |\n| --- | --- | --- |\ncomment1\ncomment2\n <!-- flags:example-flag,sample-flag -->\n <!-- comment hash: f435824b364fb2975c40d11b9a3dd10e -->"
assert.Equal(t, expected, comment)
}

Expand All @@ -197,7 +197,7 @@ func (e *testCommentBuilder) AddedAndRemoved(t *testing.T) {
e.Comments.CommentsRemoved = []string{"comment1", "comment2"}
comment := BuildFlagComment(e.Comments, e.FlagsRef, nil)

expected := "## LaunchDarkly flag references\n### :green_circle: 1 flag reference added or modified\n\n| Name | Key | Aliases found |\n| --- | --- | --- |\ncomment1\ncomment2\n\n\n### :red_circle: 1 flag reference removed\n\n| Name | Key | Aliases found |\n| --- | --- | --- |\ncomment1\ncomment2\n <!-- flags:example-flag -->\n <!-- comment hash: ef0ca0c51fa26dc61b10100ef1bf55eb -->"
expected := "## LaunchDarkly flag references\n### :mag: 1 flag reference added or modified\n\n| Name | Key | Aliases found |\n| --- | --- | --- |\ncomment1\ncomment2\n\n\n### :x: 1 flag reference removed\n\n| Name | Key | Aliases found |\n| --- | --- | --- |\ncomment1\ncomment2\n <!-- flags:example-flag -->\n <!-- comment hash: f8202009f99955ff5416771ef8358a24 -->"

assert.Equal(t, expected, comment)

Expand Down

0 comments on commit d022b58

Please sign in to comment.