Skip to content

Commit d0b4e23

Browse files
committed
fix: updating several files
1 parent 0ca7210 commit d0b4e23

File tree

4 files changed

+5
-49
lines changed

4 files changed

+5
-49
lines changed

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ go.spyder.org/gen v0.0.0-20250731191358-38409dc1c909 h1:pVGzxPcB7y2Jc9YAXCeoyvrI
6969
go.spyder.org/gen v0.0.0-20250731191358-38409dc1c909/go.mod h1:BfFefPrrtCxBCu7l+gSyZ9f+IN5uTnteSyy6ELp5/DE=
7070
go.spyder.org/log v0.0.0-20250411010018-06225209381d h1:Z6RefmPbLtaFjBN2U+7Y9tIoTYoovjp00LGE6x0UGI0=
7171
go.spyder.org/log v0.0.0-20250411010018-06225209381d/go.mod h1:LWFHqLLCB9rLX+pk9sp9GMJ7EIRD/ThGpanDZj73+PA=
72+
go.spyder.org/opt v0.0.0-20250731184948-379c8b395af6 h1:3a75ayxW6XU9TLS3BZirwuN2SOesi0jYf4eLNBmrT6k=
73+
go.spyder.org/opt v0.0.0-20250731184948-379c8b395af6/go.mod h1:HY+AJfqv41i8GXX7ZPUFvbjEOs9hyTTBKy5afqtuu/w=
7274
go.spyder.org/opt v0.0.0-20250806215718-85d689e69ed2 h1:jGWOyIpkmPhJs6j4VW3bwIoqdzDfeRTInL3vs6BfdmQ=
7375
go.spyder.org/opt v0.0.0-20250806215718-85d689e69ed2/go.mod h1:cryQLNphY3J24HJzqhnpw7QTB64wv8cqiE3fpzPGdVU=
7476
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=

sub/report/cmd.go

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,14 @@ package report
33
import (
44
"encoding/json"
55
"errors"
6-
"log/slog"
76
"os"
8-
"sync"
97

108
"github.com/spf13/cobra"
11-
"go.spyder.org/gen/cli"
129
)
1310

1411
var Cmd = &cobra.Command{Use: "report", Short: "print summary from status.json", RunE: Run}
1512

1613
func init() {
17-
if err := cli.SetArgs(Cmd.Flags(), "", Args()); err != nil {
18-
slog.Error("error setting arguments", "error", err, "args", Args())
19-
return
20-
}
2114
f := Cmd.Flags()
2215
f.String("input", "status.json", "status.json to summarize")
2316
}
@@ -42,13 +35,4 @@ func Run(cmd *cobra.Command, args []string) error {
4235
return nil
4336
}
4437

45-
//nolint:gochecknoglobals
46-
var once sync.Once
47-
48-
//nolint:gochecknoglobals
49-
var args cli.Args
50-
51-
func Args() cli.Args {
52-
once.Do(func() { args = cli.Args{} })
53-
return args
54-
}
38+
// removed external cli arg reflection dependency

sub/scan/cmd.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,16 @@ package scan
33
import (
44
"log/slog"
55
"regexp"
6-
"sync"
76

87
"github.com/spf13/cobra"
98
"go.codepros.org/canary/internal/cli/exitcodes"
109
"go.codepros.org/canary/internal/core"
11-
"go.spyder.org/gen/cli"
1210
)
1311

1412
// CANARY: REQ=CBIN-101; FEATURE="ScannerCore"; ASPECT=Engine; STATUS=TESTED; TEST=TestCANARY_CBIN_101_Engine_ScanBasic; BENCH=BenchmarkCANARY_CBIN_101_Engine_Scan; OWNER=canary; UPDATED=2025-09-20
1513
var Cmd = &cobra.Command{Use: "scan", Short: "scan the given paths for CANARY tokens", RunE: Run}
1614

1715
func init() {
18-
if err := cli.SetArgs(Cmd.Flags(), "", Args()); err != nil {
19-
slog.Error("error setting arguments", "error", err, "args", Args())
20-
return
21-
}
2216
f := Cmd.Flags()
2317
f.String("root", ".", "root directory to scan")
2418
f.String("out", "status.json", "output status.json path")
@@ -46,13 +40,4 @@ func Run(cmd *cobra.Command, args []string) error {
4640
return nil
4741
}
4842

49-
//nolint:gochecknoglobals
50-
var once sync.Once
51-
52-
//nolint:gochecknoglobals
53-
var args cli.Args
54-
55-
func Args() cli.Args {
56-
once.Do(func() { args = cli.Args{} })
57-
return args
58-
}
43+
// removed external cli arg reflection dependency

sub/verify/cmd.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,17 @@ package verify
33
import (
44
"log/slog"
55
"regexp"
6-
"sync"
76
"time"
87

98
"github.com/spf13/cobra"
109
"go.codepros.org/canary/internal/cli/exitcodes"
1110
"go.codepros.org/canary/internal/core"
12-
"go.spyder.org/gen/cli"
1311
)
1412

1513
// CANARY: REQ=CBIN-102; FEATURE="VerifyGate"; ASPECT=CLI; STATUS=TESTED; TEST=TestCANARY_CBIN_102_CLI_Verify; BENCH=BenchmarkCANARY_CBIN_102_CLI_Verify; OWNER=canary; UPDATED=2025-09-20
1614
var Cmd = &cobra.Command{Use: "verify", Short: "verify GAP claims & optional staleness", RunE: Run}
1715

1816
func init() {
19-
if err := cli.SetArgs(Cmd.Flags(), "", Args()); err != nil {
20-
slog.Error("error setting arguments", "error", err, "args", Args())
21-
return
22-
}
2317
f := Cmd.Flags()
2418
f.String("root", ".", "root directory to scan before verification")
2519
f.String("gap", "GAP_ANALYSIS.md", "gap analysis file to verify")
@@ -65,13 +59,4 @@ func Run(cmd *cobra.Command, args []string) error {
6559
return nil
6660
}
6761

68-
//nolint:gochecknoglobals
69-
var once sync.Once
70-
71-
//nolint:gochecknoglobals
72-
var args cli.Args
73-
74-
func Args() cli.Args {
75-
once.Do(func() { args = cli.Args{} })
76-
return args
77-
}
62+
// removed external cli arg reflection dependency

0 commit comments

Comments
 (0)