Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

design: update emojis used #43

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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