From f3eff585c4a30dfd6c452146ec05301d49a840da Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 1 Mar 2026 00:26:23 -0700 Subject: [PATCH] feat(monorel): match goreleaser comment style in generated .goreleaser.yaml - Replace "Generated by monorel" header with goreleaser-style preamble ("This file is generated by monorel ... check the docs at goreleaser.com") - Add modeline explainer comment block before the yaml-language-server line - Add "you may remove this if you don't need go generate" comment inline - Combine name_template comments into goreleaser-style single comment ("this name template makes the OS and Arch compatible with uname") --- tools/monorel/main.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/monorel/main.go b/tools/monorel/main.go index f196155..5859c15 100644 --- a/tools/monorel/main.go +++ b/tools/monorel/main.go @@ -1188,11 +1188,16 @@ func goreleaserYAML(projectName string, bins []binary) string { w := func(s string) { b.WriteString(s) } wf := func(format string, args ...any) { fmt.Fprintf(&b, format, args...) } + w("# This file is generated by monorel (github.com/therootcompany/golib/tools/monorel).\n") + w("# Make sure to check the documentation at https://goreleaser.com\n") + w("\n# The lines below are called `modelines`. See `:help modeline`\n") + w("# Feel free to remove those if you don't want/need to use them.\n") w("# yaml-language-server: $schema=https://goreleaser.com/static/schema.json\n") w("# vim: set ts=2 sw=2 tw=0 fo=cnqoj\n") - w("# Generated by monorel (github.com/therootcompany/golib/tools/monorel)\n") w("\nversion: 2\n") - w("\nbefore:\n hooks:\n - go mod tidy\n - go generate ./...\n") + w("\nbefore:\n hooks:\n - go mod tidy\n") + w(" # you may remove this if you don't need go generate\n") + w(" - go generate ./...\n") w("\nbuilds:\n") for _, bin := range bins { @@ -1216,8 +1221,8 @@ func goreleaserYAML(projectName string, bins []binary) string { wf(" - id: %s\n", bin.name) wf(" ids: [%s]\n", bin.name) w(" formats: [tar.gz, tar.zst]\n") - w(" # name_template uses VERSION env var so the prefixed monorepo tag\n") - w(" # doesn't appear in archive filenames.\n") + w(" # this name template makes the OS and Arch compatible with the results of `uname`.\n") + w(" # it uses the VERSION env var so the prefixed monorepo tag doesn't appear in archive filenames.\n") w(" name_template: >-\n") wf(" %s_{{ .Env.VERSION }}_\n", bin.name) w(" {{- title .Os }}_\n")