From dc621e6d96aec4729fea31e4f189ada4e615e2a9 Mon Sep 17 00:00:00 2001 From: Alex Dunmow Date: Fri, 3 Jul 2026 13:53:46 +0800 Subject: [PATCH] chore(ninja): check fmt.Fprintln returns in publish warnings (errcheck) Pre-existing strict-lint failures in the publish warning helpers were the only thing keeping check-safety's Go lint lane red for the module; discard the writer errors explicitly (warnings are best-effort output). Co-Authored-By: Claude Fable 5 --- cmd/ninja/cmd/plugin.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/ninja/cmd/plugin.go b/cmd/ninja/cmd/plugin.go index 999b223..99a8dcd 100644 --- a/cmd/ninja/cmd/plugin.go +++ b/cmd/ninja/cmd/plugin.go @@ -1115,11 +1115,11 @@ func gitignoredTrackedWarning(repoDir string, w io.Writer) { if names == "" { return } - fmt.Fprintln(w, "warning: these tracked files match .gitignore and will still be shipped:") + _, _ = fmt.Fprintln(w, "warning: these tracked files match .gitignore and will still be shipped:") for n := range strings.SplitSeq(names, "\n") { - fmt.Fprintln(w, " "+n) + _, _ = fmt.Fprintln(w, " "+n) } - fmt.Fprintln(w, " (run `git rm --cached ` to drop)") + _, _ = fmt.Fprintln(w, " (run `git rm --cached ` to drop)") } // untrackedFilesWarning writes a warning to w listing untracked files in @@ -1134,11 +1134,11 @@ func untrackedFilesWarning(repoDir string, w io.Writer) { if names == "" { return } - fmt.Fprintln(w, "warning: these untracked files will NOT be in the archive:") + _, _ = fmt.Fprintln(w, "warning: these untracked files will NOT be in the archive:") for n := range strings.SplitSeq(names, "\n") { - fmt.Fprintln(w, " "+n) + _, _ = fmt.Fprintln(w, " "+n) } - fmt.Fprintln(w, " (run `git add ` if they should be shipped)") + _, _ = fmt.Fprintln(w, " (run `git add ` if they should be shipped)") } // emitPublishWarnings runs the publish-time warning helpers in the order the @@ -1181,11 +1181,11 @@ func submoduleWarning(repoDir string, w io.Writer) { if len(paths) == 0 { return } - fmt.Fprintln(w, "warning: this repo has submodules; git archive will ship them as empty directories:") + _, _ = fmt.Fprintln(w, "warning: this repo has submodules; git archive will ship them as empty directories:") for _, p := range paths { - fmt.Fprintln(w, " "+p) + _, _ = fmt.Fprintln(w, " "+p) } - fmt.Fprintln(w, " (vendor the contents or pack them separately if the plugin depends on them)") + _, _ = fmt.Fprintln(w, " (vendor the contents or pack them separately if the plugin depends on them)") } // autoCommitPluginMod stages and commits plugin.mod with the given message,