Skip to content

Commit 94e072b

Browse files
fix(cli): clear golangci lint debt
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
1 parent 8cf2f14 commit 94e072b

28 files changed

Lines changed: 97 additions & 74 deletions

cmd/gitant/advanced.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ func init() {
282282
// Kanban
283283
for _, c := range []*cobra.Command{kanbanListCmd, kanbanCreateCmd} {
284284
c.Flags().StringP("repo", "r", "", "Repository name (required)")
285-
c.MarkFlagRequired("repo")
285+
_ = c.MarkFlagRequired("repo")
286286
c.Flags().String("daemon-url", "", "Daemon URL")
287287
}
288288
kanbanCreateCmd.Flags().StringP("name", "n", "", "Board name")
@@ -291,7 +291,7 @@ func init() {
291291
// Epic
292292
for _, c := range []*cobra.Command{epicListCmd, epicCreateCmd} {
293293
c.Flags().StringP("repo", "r", "", "Repository name (required)")
294-
c.MarkFlagRequired("repo")
294+
_ = c.MarkFlagRequired("repo")
295295
c.Flags().String("daemon-url", "", "Daemon URL")
296296
}
297297
epicListCmd.Flags().String("status", "", "Filter by status")
@@ -308,7 +308,7 @@ func init() {
308308
// Stacked
309309
for _, c := range []*cobra.Command{stackListCmd} {
310310
c.Flags().StringP("repo", "r", "", "Repository name (required)")
311-
c.MarkFlagRequired("repo")
311+
_ = c.MarkFlagRequired("repo")
312312
c.Flags().String("daemon-url", "", "Daemon URL")
313313
}
314314
stackedCmd.AddCommand(stackListCmd)

cmd/gitant/bounties.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ var bountyCreateCmd = &cobra.Command{
6666
}
6767
if amount == 0 {
6868
fmt.Print("Amount: ")
69-
fmt.Scan(&amount)
69+
if _, err := fmt.Scan(&amount); err != nil {
70+
fmt.Fprintf(os.Stderr, "Error reading amount: %v\n", err)
71+
os.Exit(1)
72+
}
7073
}
7174

7275
client := cli.NewClient(daemonURL)
@@ -158,7 +161,7 @@ func init() {
158161
bountyListCmd.Flags().StringP("repo", "r", "", "Repository name")
159162
bountyListCmd.Flags().String("status", "", "Filter by status (open|claimed|submitted|approved)")
160163
bountyCreateCmd.Flags().StringP("repo", "r", "", "Repository name (required)")
161-
bountyCreateCmd.MarkFlagRequired("repo")
164+
_ = bountyCreateCmd.MarkFlagRequired("repo")
162165
bountyCreateCmd.Flags().StringP("title", "t", "", "Bounty title")
163166
bountyCreateCmd.Flags().StringP("description", "d", "", "Bounty description")
164167
bountyCreateCmd.Flags().Float64P("amount", "a", 0, "Bounty amount")

cmd/gitant/ci.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func getCurrentBranch() string {
196196
func init() {
197197
for _, c := range []*cobra.Command{ciListCmd, ciViewCmd, ciLogsCmd, ciRetryCmd, ciCancelCmd, ciStatusCmd} {
198198
c.Flags().StringP("repo", "r", "", "Repository name (required)")
199-
c.MarkFlagRequired("repo")
199+
_ = c.MarkFlagRequired("repo")
200200
c.Flags().String("daemon-url", "", "Daemon URL (default: http://localhost:7777)")
201201
}
202202
ciListCmd.Flags().String("status", "", "Filter by status (pending|running|success|failed)")

cmd/gitant/community.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ func init() {
389389
// Forum
390390
for _, c := range []*cobra.Command{forumListCmd, forumCreateCmd} {
391391
c.Flags().StringP("repo", "r", "", "Repository name (required)")
392-
c.MarkFlagRequired("repo")
392+
_ = c.MarkFlagRequired("repo")
393393
c.Flags().String("daemon-url", "", "Daemon URL")
394394
}
395395
forumListCmd.Flags().String("category", "", "Filter by category")
@@ -401,7 +401,7 @@ func init() {
401401
// Chat
402402
for _, c := range []*cobra.Command{chatSendCmd, chatReadCmd} {
403403
c.Flags().StringP("repo", "r", "", "Repository name (required)")
404-
c.MarkFlagRequired("repo")
404+
_ = c.MarkFlagRequired("repo")
405405
c.Flags().String("daemon-url", "", "Daemon URL")
406406
}
407407
chatSendCmd.Flags().String("channel", "general", "Channel")
@@ -413,7 +413,7 @@ func init() {
413413
// Workspace
414414
for _, c := range []*cobra.Command{workspaceListCmd, workspaceCreateCmd} {
415415
c.Flags().StringP("repo", "r", "", "Repository name (required)")
416-
c.MarkFlagRequired("repo")
416+
_ = c.MarkFlagRequired("repo")
417417
c.Flags().String("daemon-url", "", "Daemon URL")
418418
}
419419
workspaceCreateCmd.Flags().StringP("name", "n", "", "Workspace name")
@@ -423,7 +423,7 @@ func init() {
423423
// Service Desk
424424
for _, c := range []*cobra.Command{serviceDeskListCmd} {
425425
c.Flags().StringP("repo", "r", "", "Repository name (required)")
426-
c.MarkFlagRequired("repo")
426+
_ = c.MarkFlagRequired("repo")
427427
c.Flags().String("daemon-url", "", "Daemon URL")
428428
}
429429
serviceDeskListCmd.Flags().String("status", "", "Filter by status")
@@ -432,7 +432,7 @@ func init() {
432432
// Time
433433
for _, c := range []*cobra.Command{timeStartCmd, timeStopCmd, timeSummaryCmd} {
434434
c.Flags().StringP("repo", "r", "", "Repository name (required)")
435-
c.MarkFlagRequired("repo")
435+
_ = c.MarkFlagRequired("repo")
436436
c.Flags().String("daemon-url", "", "Daemon URL")
437437
}
438438
timeStartCmd.Flags().StringP("description", "d", "", "Description")
@@ -441,7 +441,7 @@ func init() {
441441
// Governance
442442
for _, c := range []*cobra.Command{governanceListCmd, governanceVoteCmd} {
443443
c.Flags().StringP("repo", "r", "", "Repository name (required)")
444-
c.MarkFlagRequired("repo")
444+
_ = c.MarkFlagRequired("repo")
445445
c.Flags().String("daemon-url", "", "Daemon URL")
446446
}
447447
governanceListCmd.Flags().String("status", "", "Filter by status")

cmd/gitant/deployments.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ var deploymentRollbackCmd = &cobra.Command{
126126
func init() {
127127
for _, c := range []*cobra.Command{deploymentListCmd, deploymentCreateCmd, deploymentStatusCmd, deploymentRollbackCmd} {
128128
c.Flags().StringP("repo", "r", "", "Repository name (required)")
129-
c.MarkFlagRequired("repo")
129+
_ = c.MarkFlagRequired("repo")
130130
c.Flags().String("daemon-url", "", "Daemon URL (default: http://localhost:7777)")
131131
}
132132
deploymentListCmd.Flags().String("environment", "", "Filter by environment")

cmd/gitant/doctor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ var doctorCmd = &cobra.Command{
5656
fmt.Println("\nDaemon:")
5757
resp, err := http.Get(daemonURL + "/health")
5858
if resp != nil {
59-
defer resp.Body.Close()
59+
defer func() { _ = resp.Body.Close() }()
6060
}
6161
check("Daemon reachable", err == nil && resp != nil && resp.StatusCode == 200,
6262
func() string {

cmd/gitant/environments.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ var environmentDeleteCmd = &cobra.Command{
8585
func init() {
8686
for _, c := range []*cobra.Command{environmentListCmd, environmentCreateCmd, environmentDeleteCmd} {
8787
c.Flags().StringP("repo", "r", "", "Repository name (required)")
88-
c.MarkFlagRequired("repo")
88+
_ = c.MarkFlagRequired("repo")
8989
c.Flags().String("daemon-url", "", "Daemon URL (default: http://localhost:7777)")
9090
}
9191

cmd/gitant/gitlawb_commands.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ func init() {
445445
// Cert flags
446446
for _, c := range []*cobra.Command{certListCmd, certShowCmd} {
447447
c.Flags().StringP("repo", "r", "", "Repository name (required)")
448-
c.MarkFlagRequired("repo")
448+
_ = c.MarkFlagRequired("repo")
449449
c.Flags().String("daemon-url", "", "Daemon URL")
450450
}
451451

cmd/gitant/gitlawb_deep_parity.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ func init() {
417417
// Secrets flags
418418
for _, c := range []*cobra.Command{secretsListCmd, secretsSetCmd, secretsGetCmd, secretsDeleteCmd} {
419419
c.Flags().StringP("repo", "r", "", "Repository name (required)")
420-
c.MarkFlagRequired("repo")
420+
_ = c.MarkFlagRequired("repo")
421421
c.Flags().String("daemon-url", "", "Daemon URL")
422422
}
423423

@@ -434,7 +434,7 @@ func init() {
434434
// Maintainers flags
435435
for _, c := range []*cobra.Command{maintainersListCmd, maintainersAddCmd, maintainersRemoveCmd} {
436436
c.Flags().StringP("repo", "r", "", "Repository name (required)")
437-
c.MarkFlagRequired("repo")
437+
_ = c.MarkFlagRequired("repo")
438438
c.Flags().String("daemon-url", "", "Daemon URL")
439439
}
440440

cmd/gitant/gitlawb_parity.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,18 +353,18 @@ func init() {
353353
// Bounty flags
354354
for _, c := range []*cobra.Command{bountyApproveCmd, bountyCancelCmd, bountyStatsCmd} {
355355
c.Flags().StringP("repo", "r", "", "Repository name (required)")
356-
c.MarkFlagRequired("repo")
356+
_ = c.MarkFlagRequired("repo")
357357
c.Flags().String("daemon-url", "", "Daemon URL")
358358
}
359359

360360
// Task flags
361361
taskFailCmd.Flags().StringP("repo", "r", "", "Repository name (required)")
362-
taskFailCmd.MarkFlagRequired("repo")
362+
_ = taskFailCmd.MarkFlagRequired("repo")
363363
taskFailCmd.Flags().String("daemon-url", "", "Daemon URL")
364364

365365
// Cert flags
366366
certVerifyCmd.Flags().StringP("repo", "r", "", "Repository name (required)")
367-
certVerifyCmd.MarkFlagRequired("repo")
367+
_ = certVerifyCmd.MarkFlagRequired("repo")
368368
certVerifyCmd.Flags().String("daemon-url", "", "Daemon URL")
369369

370370
// Register subcommands

0 commit comments

Comments
 (0)