Skip to content

Commit 58122f2

Browse files
authored
Merge pull request #9024 from Dhairya-Arora01/fixGrammar
🌱 fixed grammatically incorrect plurals in release tools
2 parents 1825702 + 1c1eaa1 commit 58122f2

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
@@ -322,16 +322,24 @@ func run() int {
322322
fmt.Printf("## Changes since %v\n---\n", commitRange)
323323

324324
fmt.Printf("## :chart_with_upwards_trend: Overview\n")
325-
if count := len(commits); count > 0 {
325+
if count := len(commits); count == 1 {
326+
fmt.Println("- 1 new commit merged")
327+
} else if count > 1 {
326328
fmt.Printf("- %d new commits merged\n", count)
327329
}
328-
if count := len(merges[warning]); count > 0 {
330+
if count := len(merges[warning]); count == 1 {
331+
fmt.Println("- 1 breaking change :warning:")
332+
} else if count > 1 {
329333
fmt.Printf("- %d breaking changes :warning:\n", count)
330334
}
331-
if count := len(merges[features]); count > 0 {
335+
if count := len(merges[features]); count == 1 {
336+
fmt.Println("- 1 feature addition ✨")
337+
} else if count > 1 {
332338
fmt.Printf("- %d feature additions ✨\n", count)
333339
}
334-
if count := len(merges[bugs]); count > 0 {
340+
if count := len(merges[bugs]); count == 1 {
341+
fmt.Println("- 1 bug fixed 🐛")
342+
} else if count > 1 {
335343
fmt.Printf("- %d bugs fixed 🐛\n", count)
336344
}
337345
fmt.Println()
@@ -344,11 +352,18 @@ func run() int {
344352

345353
switch key {
346354
case documentation:
347-
fmt.Printf(
348-
":book: Additionally, there have been %d contributions to our documentation and book. (%s) \n\n",
349-
len(mergeslice),
350-
strings.Join(mergeslice, ", "),
351-
)
355+
if len(mergeslice) == 1 {
356+
fmt.Printf(
357+
":book: Additionally, there has been 1 contribution to our documentation and book. (%s) \n\n",
358+
mergeslice[0],
359+
)
360+
} else {
361+
fmt.Printf(
362+
":book: Additionally, there have been %d contributions to our documentation and book. (%s) \n\n",
363+
len(mergeslice),
364+
strings.Join(mergeslice, ", "),
365+
)
366+
}
352367
default:
353368
fmt.Println("## " + key)
354369
sort.Strings(mergeslice)

0 commit comments

Comments
 (0)