diff --git a/cmd/g/g.go b/cmd/g/g.go index 7bf1604ce7d4272c2e5e7b21eecfebf9ef7c5b60..3608da7194f59e6754a014a127446a03976f76e1 100644 --- a/cmd/g/g.go +++ b/cmd/g/g.go @@ -38,8 +38,8 @@ func runShowGoal(cmd *cobra.Command, _ []string) error { } if state.Goal == nil { - fmt.Fprintln(cmd.OutOrStdout(), "") - fmt.Fprintln(cmd.OutOrStdout(), "Set the goal with `np g s -t \"goal title\" -d \"goal description\"` to begin.") + _, _ = fmt.Fprintln(cmd.OutOrStdout(), "") + _, _ = fmt.Fprintln(cmd.OutOrStdout(), "Set the goal with `np g s -t \"goal title\" -d \"goal description\"` to begin.") } return nil } diff --git a/cmd/g/s.go b/cmd/g/s.go index c3c7013452bb6445b091a6d662b05c3447c2e22b..bc7fd0fbe4a849d18f33e0225d412371da66b283 100644 --- a/cmd/g/s.go +++ b/cmd/g/s.go @@ -58,11 +58,11 @@ func runSetGoal(cmd *cobra.Command, _ []string) error { description = strings.TrimSpace(description) if title == "" { - fmt.Fprintln(cmd.OutOrStdout(), "Goal title is required.") + _, _ = fmt.Fprintln(cmd.OutOrStdout(), "Goal title is required.") return nil } if description == "" { - fmt.Fprintln(cmd.OutOrStdout(), "Goal description is required.") + _, _ = fmt.Fprintln(cmd.OutOrStdout(), "Goal description is required.") return nil } @@ -71,7 +71,7 @@ func runSetGoal(cmd *cobra.Command, _ []string) error { return err } if exists { - fmt.Fprintln(cmd.OutOrStdout(), "Goal already set. Use 'np g u' to update it (requires -r/--reason flag).") + _, _ = fmt.Fprintln(cmd.OutOrStdout(), "Goal already set. Use 'np g u' to update it (requires -r/--reason flag).") return nil } @@ -102,10 +102,10 @@ func runSetGoal(cmd *cobra.Command, _ []string) error { } out := cmd.OutOrStdout() - fmt.Fprintln(out, "") - fmt.Fprintln(out, "Study the goal and its description carefully.") - fmt.Fprintln(out, "Review referenced tickets and files to gather context before planning changes.") - fmt.Fprintln(out, "Add tasks with `np t a -t \"task title\" -d \"details\"` once you understand the approach.") + _, _ = fmt.Fprintln(out, "") + _, _ = fmt.Fprintln(out, "Study the goal and its description carefully.") + _, _ = fmt.Fprintln(out, "Review referenced tickets and files to gather context before planning changes.") + _, _ = fmt.Fprintln(out, "Add tasks with `np t a -t \"task title\" -d \"details\"` once you understand the approach.") return nil } diff --git a/cmd/g/u.go b/cmd/g/u.go index a4983733dd67fd272795a8e4021fc0fd56142cd3..1d2ad56c73ef3aea2b0673994495360b332712bc 100644 --- a/cmd/g/u.go +++ b/cmd/g/u.go @@ -49,7 +49,7 @@ func runUpdateGoal(cmd *cobra.Command, _ []string) error { current, err := env.GoalStore.Get(cmd.Context(), sessionDoc.SID) if err != nil { if errors.Is(err, goal.ErrNotFound) { - fmt.Fprintln(cmd.OutOrStdout(), "No goal set yet. Use 'np g s' first.") + _, _ = fmt.Fprintln(cmd.OutOrStdout(), "No goal set yet. Use 'np g s' first.") return nil } return err @@ -70,7 +70,7 @@ func runUpdateGoal(cmd *cobra.Command, _ []string) error { reason = strings.TrimSpace(reason) if reason == "" { - fmt.Fprintln(cmd.OutOrStdout(), "Reason is required for goal updates.") + _, _ = fmt.Fprintln(cmd.OutOrStdout(), "Reason is required for goal updates.") return nil } @@ -78,7 +78,7 @@ func runUpdateGoal(cmd *cobra.Command, _ []string) error { if cmd.Flags().Changed("title") { newTitle = strings.TrimSpace(titleInput) if newTitle == "" { - fmt.Fprintln(cmd.OutOrStdout(), "Goal title cannot be empty.") + _, _ = fmt.Fprintln(cmd.OutOrStdout(), "Goal title cannot be empty.") return nil } } @@ -89,12 +89,12 @@ func runUpdateGoal(cmd *cobra.Command, _ []string) error { } if !cmd.Flags().Changed("title") && !cmd.Flags().Changed("description") { - fmt.Fprintln(cmd.OutOrStdout(), "Provide at least one of --title or --description to update the goal.") + _, _ = fmt.Fprintln(cmd.OutOrStdout(), "Provide at least one of --title or --description to update the goal.") return nil } if newTitle == current.Title && newDescription == current.Description { - fmt.Fprintln(cmd.OutOrStdout(), "Goal already matches the provided values; no changes made.") + _, _ = fmt.Fprintln(cmd.OutOrStdout(), "Goal already matches the provided values; no changes made.") return nil } @@ -126,9 +126,9 @@ func runUpdateGoal(cmd *cobra.Command, _ []string) error { } out := cmd.OutOrStdout() - fmt.Fprintln(out, "") - fmt.Fprintln(out, "Goal updated. Ensure pending tasks still align and adjust them if necessary.") - fmt.Fprintln(out, "Add or update tasks with `np t a` / `np t u` so the plan reflects the new direction.") + _, _ = fmt.Fprintln(out, "") + _, _ = fmt.Fprintln(out, "Goal updated. Ensure pending tasks still align and adjust them if necessary.") + _, _ = fmt.Fprintln(out, "Add or update tasks with `np t a` / `np t u` so the plan reflects the new direction.") return nil } diff --git a/cmd/r.go b/cmd/r.go index 1f8bfa65694701bc8b6d713f0f395c0dca42fe41..001dc537c72cb917620f065e3605b834aa414312 100644 --- a/cmd/r.go +++ b/cmd/r.go @@ -40,12 +40,12 @@ func runResume(cmd *cobra.Command, args []string) error { } // Print instructions for resuming work - fmt.Fprintln(cmd.OutOrStdout(), strings.Repeat("-", 80)) - fmt.Fprintln(cmd.OutOrStdout(), "\nResuming session. To continue:") - fmt.Fprintln(cmd.OutOrStdout(), "1. Check the goal description above for any bug/issue/ticket ID. If present, read that ticket for full context.") - fmt.Fprintln(cmd.OutOrStdout(), "2. Read the files and symbols referenced in the pending tasks to understand what work remains.") - fmt.Fprintln(cmd.OutOrStdout(), "3. Update task status as you work: `np t u -i -s `") - fmt.Fprintln(cmd.OutOrStdout(), " Statuses: pending, in_progress, completed, failed, cancelled") + _, _ = fmt.Fprintln(cmd.OutOrStdout(), strings.Repeat("-", 80)) + _, _ = fmt.Fprintln(cmd.OutOrStdout(), "\nResuming session. To continue:") + _, _ = fmt.Fprintln(cmd.OutOrStdout(), "1. Check the goal description above for any bug/issue/ticket ID. If present, read that ticket for full context.") + _, _ = fmt.Fprintln(cmd.OutOrStdout(), "2. Read the files and symbols referenced in the pending tasks to understand what work remains.") + _, _ = fmt.Fprintln(cmd.OutOrStdout(), "3. Update task status as you work: `np t u -i -s `") + _, _ = fmt.Fprintln(cmd.OutOrStdout(), " Statuses: pending, in_progress, completed, failed, cancelled") // Provide context about pending work pendingCount := 0 @@ -60,10 +60,10 @@ func runResume(cmd *cobra.Command, args []string) error { } if inProgressCount > 0 { - fmt.Fprintf(cmd.OutOrStdout(), "\n%d task(s) are in progress.\n", inProgressCount) + _, _ = fmt.Fprintf(cmd.OutOrStdout(), "\n%d task(s) are in progress.\n", inProgressCount) } if pendingCount > 0 { - fmt.Fprintf(cmd.OutOrStdout(), "%d task(s) are pending.\n", pendingCount) + _, _ = fmt.Fprintf(cmd.OutOrStdout(), "%d task(s) are pending.\n", pendingCount) } return nil diff --git a/cmd/s.go b/cmd/s.go index 6846d308c2ea61d919c4366f2e2b7daf354ec0cf..94b10c3f12302cd1b7f62a35d80bbb66e2d056a9 100644 --- a/cmd/s.go +++ b/cmd/s.go @@ -47,18 +47,18 @@ func runStartSession(cmd *cobra.Command, args []string) error { func printExistingSession(cmd *cobra.Command, existing session.Document) error { out := cmd.OutOrStdout() - fmt.Fprintf(out, "Session %s is already active for %s.\n", existing.SID, existing.DirPath) - fmt.Fprintln(out, "There's already an active session for this directory; ask your operator whether they want to resume or archive it.") + _, _ = fmt.Fprintf(out, "Session %s is already active for %s.\n", existing.SID, existing.DirPath) + _, _ = fmt.Fprintln(out, "There's already an active session for this directory; ask your operator whether they want to resume or archive it.") return nil } func printSessionStarted(cmd *cobra.Command, doc session.Document) { out := cmd.OutOrStdout() - fmt.Fprintf(out, "Session %s is now active for %s.\n\n", doc.SID, doc.DirPath) + _, _ = fmt.Fprintf(out, "Session %s is now active for %s.\n\n", doc.SID, doc.DirPath) - fmt.Fprintln(out, "Set the goal immediately with `np g s -t \"goal title\" -d \"goal description\"`.") - fmt.Fprintln(out, "Include ticket numbers, file paths, and any other references inside the goal description.") - fmt.Fprintln(out, "Once the goal is set, read the referenced files and add tasks with `np t a -t \"task\" -d \"details\"`.") - fmt.Fprintln(out, "Keep task statuses up to date with `np t u -i task-id -s in_progress|completed|failed|cancelled` as you work.") - fmt.Fprintln(out, "Use `np p` whenever you need to review the full plan.") + _, _ = fmt.Fprintln(out, "Set the goal immediately with `np g s -t \"goal title\" -d \"goal description\"`.") + _, _ = fmt.Fprintln(out, "Include ticket numbers, file paths, and any other references inside the goal description.") + _, _ = fmt.Fprintln(out, "Once the goal is set, read the referenced files and add tasks with `np t a -t \"task\" -d \"details\"`.") + _, _ = fmt.Fprintln(out, "Keep task statuses up to date with `np t u -i task-id -s in_progress|completed|failed|cancelled` as you work.") + _, _ = fmt.Fprintln(out, "Use `np p` whenever you need to review the full plan.") } diff --git a/cmd/shared/helpers.go b/cmd/shared/helpers.go index c934ae2be5b4f0b27658eb99af711fe0281e4e1c..99d5c3001f8653ed741a18af560bd432be4334ec 100644 --- a/cmd/shared/helpers.go +++ b/cmd/shared/helpers.go @@ -35,7 +35,7 @@ func ActiveSession(cmd *cobra.Command, env *cli.Environment) (session.Document, return session.Document{}, false, err } if !found { - fmt.Fprintln(cmd.OutOrStdout(), "No active session. Start one with `np s`.") + _, _ = fmt.Fprintln(cmd.OutOrStdout(), "No active session. Start one with `np s`.") return session.Document{}, false, nil } return doc, true, nil @@ -53,6 +53,6 @@ func PrintPlan(cmd *cobra.Command, env *cli.Environment, sid string) (cli.PlanSt return cli.PlanState{}, err } - fmt.Fprintln(cmd.OutOrStdout(), cli.RenderPlan(state)) + _, _ = fmt.Fprintln(cmd.OutOrStdout(), cli.RenderPlan(state)) return state, nil }