Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/cascade_cli_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:errcheck // Legacy tests keep setup terse; production paths handle these return values explicitly.
package cmd

import (
Expand Down
1 change: 1 addition & 0 deletions cmd/context_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:errcheck // Legacy tests keep setup terse; production paths handle these return values explicitly.
package cmd

import (
Expand Down
4 changes: 3 additions & 1 deletion cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ var createCmd = &cobra.Command{
if models.IsValidType(normalized) {
typeFlag, _ := cmd.Flags().GetString("type")
if typeFlag == "" {
cmd.Flags().Set("type", string(normalized))
if err := cmd.Flags().Set("type", string(normalized)); err != nil {
return err
}
}
args = args[1:]
}
Expand Down
1 change: 1 addition & 0 deletions cmd/create_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:errcheck // Legacy tests keep setup terse; production paths handle these return values explicitly.
package cmd

import (
Expand Down
12 changes: 8 additions & 4 deletions cmd/defer.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ var deferCmd = &cobra.Command{
return err
}

database.AddLog(&models.Log{
if err := database.AddLog(&models.Log{
IssueID: issueID,
SessionID: sess.ID,
Message: "Deferral cleared",
Type: models.LogTypeProgress,
})
}); err != nil {
output.Warning("failed to record deferral log for %s: %v", issueID, err)
}

fmt.Printf("DEFERRAL CLEARED %s\n", issueID)
return nil
Expand Down Expand Up @@ -88,12 +90,14 @@ var deferCmd = &cobra.Command{
logMsg = fmt.Sprintf("Deferred until %s (deferred %d times)", dateStr, issue.DeferCount)
}

database.AddLog(&models.Log{
if err := database.AddLog(&models.Log{
IssueID: issueID,
SessionID: sess.ID,
Message: logMsg,
Type: models.LogTypeProgress,
})
}); err != nil {
output.Warning("failed to record deferral log for %s: %v", issueID, err)
}

fmt.Printf("DEFERRED %s until %s\n", issueID, dateStr)
return nil
Expand Down
1 change: 1 addition & 0 deletions cmd/delete_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:errcheck // Legacy tests keep setup terse; production paths handle these return values explicitly.
package cmd

import (
Expand Down
1 change: 1 addition & 0 deletions cmd/dependencies_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:errcheck // Legacy tests keep setup terse; production paths handle these return values explicitly.
package cmd

import (
Expand Down
12 changes: 8 additions & 4 deletions cmd/due.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ var dueCmd = &cobra.Command{
return err
}

database.AddLog(&models.Log{
if err := database.AddLog(&models.Log{
IssueID: issueID,
SessionID: sess.ID,
Message: "Due date cleared",
Type: models.LogTypeProgress,
})
}); err != nil {
output.Warning("failed to record due date log for %s: %v", issueID, err)
}

fmt.Printf("DUE DATE CLEARED %s\n", issueID)
} else {
Expand All @@ -75,12 +77,14 @@ var dueCmd = &cobra.Command{
return err
}

database.AddLog(&models.Log{
if err := database.AddLog(&models.Log{
IssueID: issueID,
SessionID: sess.ID,
Message: "Due date set: " + dateStr,
Type: models.LogTypeProgress,
})
}); err != nil {
output.Warning("failed to record due date log for %s: %v", issueID, err)
}

fmt.Printf("DUE DATE SET %s: %s\n", issueID, dateStr)
}
Expand Down
4 changes: 3 additions & 1 deletion cmd/epic.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ func init() {
epicCreateCmd.Flags().StringArray("blocks", nil, "Issues this blocks (repeatable, comma-separated)")
// Hidden type flag - set programmatically to "epic"
epicCreateCmd.Flags().StringP("type", "t", "", "")
epicCreateCmd.Flags().MarkHidden("type")
if err := epicCreateCmd.Flags().MarkHidden("type"); err != nil {
panic(err)
}

// epicListCmd flags
epicListCmd.Flags().BoolP("all", "a", false, "Show all epics including closed")
Expand Down
1 change: 1 addition & 0 deletions cmd/epic_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:errcheck // Legacy tests keep setup terse; production paths handle these return values explicitly.
package cmd

import "testing"
Expand Down
1 change: 1 addition & 0 deletions cmd/focus_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:errcheck // Legacy tests keep setup terse; production paths handle these return values explicitly.
package cmd

import (
Expand Down
6 changes: 4 additions & 2 deletions cmd/handoff.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,14 @@ Or use flags with values, stdin (-), or file (@path):
}

// Add log entry for visibility
database.AddLog(&models.Log{
if err := database.AddLog(&models.Log{
IssueID: child.ID,
SessionID: sess.ID,
Message: fmt.Sprintf("Cascaded handoff from %s", issueID),
Type: models.LogTypeProgress,
})
}); err != nil {
output.Warning("cascade handoff log %s: %v", child.ID, err)
}

cascaded++
}
Expand Down
1 change: 1 addition & 0 deletions cmd/handoff_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:errcheck // Legacy tests keep setup terse; production paths handle these return values explicitly.
package cmd

import (
Expand Down
8 changes: 6 additions & 2 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,14 @@ func addToGitignore(path string) {

// Add newline if file doesn't end with one
if len(contentStr) > 0 && !strings.HasSuffix(contentStr, "\n") {
f.WriteString("\n")
if _, err := f.WriteString("\n"); err != nil {
return
}
}

f.WriteString(".todos/\n")
if _, err := f.WriteString(".todos/\n"); err != nil {
return
}
fmt.Println("Added .todos/ to .gitignore")
}

Expand Down
6 changes: 4 additions & 2 deletions cmd/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,17 @@ Examples:

if info.IsDir() {
if recursive {
filepath.Walk(match, func(path string, info os.FileInfo, err error) error {
if err := filepath.Walk(match, func(path string, info os.FileInfo, err error) error {
if err != nil {
return nil
}
if !info.IsDir() {
allFiles = append(allFiles, path)
}
return nil
})
}); err != nil {
output.Warning("failed to walk %s: %v", match, err)
}
} else {
// Just files in the directory
entries, _ := os.ReadDir(match)
Expand Down
1 change: 1 addition & 0 deletions cmd/log_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:errcheck // Legacy tests keep setup terse; production paths handle these return values explicitly.
package cmd

import (
Expand Down
20 changes: 14 additions & 6 deletions cmd/review.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import (
func clearFocusIfNeeded(baseDir, issueID string) {
focusedID, _ := config.GetFocus(baseDir)
if focusedID == issueID {
config.ClearFocus(baseDir)
if err := config.ClearFocus(baseDir); err != nil {
output.Warning("failed to clear focus for %s: %v", issueID, err)
}
}
}

Expand Down Expand Up @@ -677,12 +679,14 @@ Supports bulk operations:
}
logMsg = fmt.Sprintf("[%s] Approved (CREATOR EXCEPTION: %s)", agentInfo, reason)
logType = models.LogTypeSecurity
db.LogSecurityEvent(baseDir, db.SecurityEvent{
if err := db.LogSecurityEvent(baseDir, db.SecurityEvent{
IssueID: issueID,
SessionID: sess.ID,
AgentType: sess.AgentType,
Reason: "creator_approval_exception: " + reason,
})
}); err != nil {
output.Warning("failed to record security event for %s: %v", issueID, err)
}
}

if err := database.AddLog(&models.Log{
Expand Down Expand Up @@ -844,7 +848,9 @@ Supports bulk operations:
if reason != "" {
result["reason"] = reason
}
output.JSON(result)
if err := output.JSON(result); err != nil {
return err
}
} else {
fmt.Printf("REJECTED %s → open\n", issueID)
}
Expand Down Expand Up @@ -979,12 +985,14 @@ Examples:
logType = models.LogTypeSecurity

// Also log to the separate security audit file
db.LogSecurityEvent(baseDir, db.SecurityEvent{
if err := db.LogSecurityEvent(baseDir, db.SecurityEvent{
IssueID: issueID,
SessionID: sess.ID,
AgentType: sess.AgentType,
Reason: selfCloseException,
})
}); err != nil {
output.Warning("failed to record security event for %s: %v", issueID, err)
}
} else if reason != "" {
logMsg = "Closed: " + reason
}
Expand Down
1 change: 1 addition & 0 deletions cmd/review_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:errcheck // Legacy tests keep setup terse; production paths handle these return values explicitly.
package cmd

import (
Expand Down
4 changes: 3 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ func logAgentError(args []string, errMsg string) {
}

// Log the error (silently fails if project not initialized)
db.LogAgentError(dir, args, errMsg, sessionID)
if err := db.LogAgentError(dir, args, errMsg, sessionID); err != nil {
slog.Debug("agent error logging failed", "err", err)
}
}

// handleUnknownFlagError checks if error is an unknown flag and suggests alternatives
Expand Down
1 change: 1 addition & 0 deletions cmd/search_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:errcheck // Legacy tests keep setup terse; production paths handle these return values explicitly.
package cmd

import (
Expand Down
1 change: 1 addition & 0 deletions cmd/security_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:errcheck // Legacy tests keep setup terse; production paths handle these return values explicitly.
package cmd

import (
Expand Down
1 change: 1 addition & 0 deletions cmd/show_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:errcheck // Legacy tests keep setup terse; production paths handle these return values explicitly.
package cmd

import (
Expand Down
16 changes: 11 additions & 5 deletions cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,26 @@ Examples:
logMsg = reason
}

database.AddLog(&models.Log{
if err := database.AddLog(&models.Log{
IssueID: issueID,
SessionID: sess.ID,
Message: logMsg,
Type: models.LogTypeProgress,
})
}); err != nil {
output.Warning("failed to record start log for %s: %v", issueID, err)
}

// Record git snapshot
if gitErr == nil {
database.AddGitSnapshot(&models.GitSnapshot{
if err := database.AddGitSnapshot(&models.GitSnapshot{
IssueID: issueID,
Event: "start",
CommitSHA: gitState.CommitSHA,
Branch: gitState.Branch,
DirtyFiles: gitState.DirtyFiles,
})
}); err != nil {
output.Warning("failed to record git snapshot for %s: %v", issueID, err)
}
}

fmt.Printf("STARTED %s (session: %s)\n", issueID, sess.ID)
Expand All @@ -153,7 +157,9 @@ Examples:

// Set focus to first issue if single issue, or clear if multiple
if len(args) == 1 && started == 1 {
config.SetFocus(baseDir, args[0])
if err := config.SetFocus(baseDir, args[0]); err != nil {
output.Warning("started %s but failed to persist focus: %v", args[0], err)
}
}

// Show git state once at the end
Expand Down
1 change: 1 addition & 0 deletions cmd/start_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:errcheck // Legacy tests keep setup terse; production paths handle these return values explicitly.
package cmd

import (
Expand Down
Loading