Skip to content

Commit 1c1eaa1

Browse files
fixed grammatically incorrect plurals in release tools
1 parent ddbf9cf commit 1c1eaa1

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

hack/tools/release/notes.go

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -313,16 +313,24 @@ func run() int {
313313
fmt.Printf("## Changes since %v\n---\n", commitRange)
314314

315315
fmt.Printf("## :chart_with_upwards_trend: Overview\n")
316-
if count := len(commits); count > 0 {
316+
if count := len(commits); count == 1 {
317+
fmt.Println("- 1 new commit merged")
318+
} else if count > 1 {
317319
fmt.Printf("- %d new commits merged\n", count)
318320
}
319-
if count := len(merges[warning]); count > 0 {
321+
if count := len(merges[warning]); count == 1 {
322+
fmt.Println("- 1 breaking change :warning:")
323+
} else if count > 1 {
320324
fmt.Printf("- %d breaking changes :warning:\n", count)
321325
}
322-
if count := len(merges[features]); count > 0 {
326+
if count := len(merges[features]); count == 1 {
327+
fmt.Println("- 1 feature addition ✨")
328+
} else if count > 1 {
323329
fmt.Printf("- %d feature additions ✨\n", count)
324330
}
325-
if count := len(merges[bugs]); count > 0 {
331+
if count := len(merges[bugs]); count == 1 {
332+
fmt.Println("- 1 bug fixed 🐛")
333+
} else if count > 1 {
326334
fmt.Printf("- %d bugs fixed 🐛\n", count)
327335
}
328336
fmt.Println()
@@ -335,11 +343,18 @@ func run() int {
335343

336344
switch key {
337345
case documentation:
338-
fmt.Printf(
339-
":book: Additionally, there have been %d contributions to our documentation and book. (%s) \n\n",
340-
len(mergeslice),
341-
strings.Join(mergeslice, ", "),
342-
)
346+
if len(mergeslice) == 1 {
347+
fmt.Printf(
348+
":book: Additionally, there has been 1 contribution to our documentation and book. (%s) \n\n",
349+
mergeslice[0],
350+
)
351+
} else {
352+
fmt.Printf(
353+
":book: Additionally, there have been %d contributions to our documentation and book. (%s) \n\n",
354+
len(mergeslice),
355+
strings.Join(mergeslice, ", "),
356+
)
357+
}
343358
default:
344359
fmt.Println("## " + key)
345360
sort.Strings(mergeslice)

0 commit comments

Comments
 (0)