Skip to content

Commit 344c1b1

Browse files
Merge pull request #1008 from Nordix/peppi-lotta/fix-release-notes-generator-and-comply-with-forbidigo
🌱 Fix notes.go so that it still complies with forbidigo
2 parents 78ca3c4 + e64eedf commit 344c1b1

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

.golangci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ issues:
183183
- stylecheck
184184
text: "ST1016: methods on the same type should have the same receiver name"
185185
path: .*(api|types)\/.*\/conversion.*\.go$
186+
- path: notes\.go
187+
linters:
188+
- forbidigo
189+
text: use of `fmt.Printf` forbidden by pattern || use of `fmt.Println` forbidden by pattern
186190
include:
187191
- EXC0002 # include "missing comments" issues from golangci-lint
188192
max-issues-per-linter: 0

hack/tools/release/notes.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -226,43 +226,43 @@ func run() int {
226226
merges[superseded] = append(merges[superseded], "- `<insert superseded bumps and reverts here>`")
227227
}
228228

229-
log.Println("<!-- markdownlint-disable no-inline-html line-length -->")
229+
fmt.Println("<!-- markdownlint-disable no-inline-html line-length -->")
230230
// TODO Turn this into a link (requires knowing the project name + organization)
231-
log.Printf("# Changes since %v\n\n", lastTag)
231+
fmt.Printf("# Changes since %v\n\n", lastTag)
232232

233233
// print the changes by category
234234
for _, key := range outputOrder {
235235
mergeslice := merges[key]
236236
if len(mergeslice) > 0 {
237-
log.Printf("## %v\n\n", key)
237+
fmt.Printf("## %v\n\n", key)
238238
for _, merge := range mergeslice {
239-
log.Println(merge)
239+
fmt.Println(merge)
240240
}
241-
log.Println()
241+
fmt.Println()
242242
}
243243

244244
// if we're doing beta/rc, print breaking changes and hide the rest of the changes
245245
if key == warning {
246246
if isBeta(latestTag) {
247-
log.Printf(warningTemplate, "BETA RELEASE")
247+
fmt.Printf(warningTemplate, "BETA RELEASE")
248248
}
249249
if isRC(latestTag) {
250-
log.Printf(warningTemplate, "RELEASE CANDIDATE")
250+
fmt.Printf(warningTemplate, "RELEASE CANDIDATE")
251251
}
252252
if isBeta(latestTag) || isRC(latestTag) {
253-
log.Printf("<details>\n")
254-
log.Printf("<summary>More details about the release</summary>\n\n")
253+
fmt.Printf("<details>\n")
254+
fmt.Printf("<summary>More details about the release</summary>\n\n")
255255
}
256256
}
257257
}
258258

259259
// then close the details if we had it open
260260
if isBeta(latestTag) || isRC(latestTag) {
261-
log.Printf("</details>\n\n")
261+
fmt.Printf("</details>\n\n")
262262
}
263263

264-
log.Printf("The container image for this release is: %v\n", latestTag)
265-
log.Println("\n_Thanks to all our contributors!_ 😊")
264+
fmt.Printf("The container image for this release is: %v\n", latestTag)
265+
fmt.Println("\n_Thanks to all our contributors!_ 😊")
266266

267267
return 0
268268
}

0 commit comments

Comments
 (0)