Skip to content

Commit 5bd5027

Browse files
renovate[bot]paralin
authored andcommitted
fix(deps): update all dependencies and fix linter errors
Signed-off-by: Christian Stewart <christian@aperture.us>
1 parent e94e49d commit 5bd5027

File tree

17 files changed

+128
-107
lines changed

17 files changed

+128
-107
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@ jobs:
3131

3232
steps:
3333
- name: Checkout repository
34-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3535

3636
- name: Setup Go ${{ matrix.go }}
37-
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
37+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
3838
with:
3939
go-version: ${{ matrix.go }}
4040

4141
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
42+
uses: github/codeql-action/init@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2
4343
with:
4444
languages: ${{ matrix.language }}
4545

4646
- name: Build Go
4747
run: go build -mod=readonly -v ./...
4848

4949
- name: Perform CodeQL Analysis
50-
uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
50+
uses: github/codeql-action/analyze@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2

.github/workflows/dependency-review.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: 'Checkout Repository'
18-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1919
- name: 'Dependency Review'
20-
uses: actions/dependency-review-action@ce3cf9537a52e8119d91fd484ab5b8a807627bf8 # v4.6.0
20+
uses: actions/dependency-review-action@40c09b7dc99638e5ddb0bfd91c1673effc064d8a # v4.8.1

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
go: ['1.24']
2020
timeout-minutes: 10
2121
steps:
22-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2323

2424
- name: Setup Go ${{ matrix.go }}
25-
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
25+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
2626
with:
2727
go-version: ${{ matrix.go }}
2828

.golangci.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.golangci.yml

Lines changed: 73 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,90 @@
1+
# Config file version V2 has been introduced, read more in lintersdb.
2+
# Visit https://golangci-lint.run/usage/configuration/#config-file
3+
version: "2"
4+
5+
# Settings for the `run` command.
6+
run:
7+
# Concurrency defines how many analyses can run simultaneously.
8+
# Default is 1.
9+
concurrency: 4
10+
# Modules-download-mode specifies how to download modules.
11+
# Allowed values: readonly, vendor, mod. Default is readonly.
12+
modules-download-mode: vendor
13+
14+
# Linters configuration.
115
linters:
216
enable:
317
- depguard
4-
- goimports
518
- gosec
6-
- gosimple
7-
- govet
819
- importas
9-
- ineffassign
1020
- misspell
1121
- revive
12-
- staticcheck
13-
- typecheck
1422
- unconvert
15-
- unused
16-
1723
disable:
1824
- errcheck
25+
settings:
26+
depguard:
27+
rules:
28+
main:
29+
deny:
30+
- pkg: io/ioutil
31+
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
32+
- pkg: "github.com/stretchr/testify/assert"
33+
desc: Use "gotest.tools/v3/assert" instead
34+
- pkg: "github.com/stretchr/testify/require"
35+
desc: Use "gotest.tools/v3/assert" instead
36+
- pkg: "github.com/stretchr/testify/suite"
37+
desc: Do not use
38+
gosec:
39+
excludes:
40+
- G306 # Allow WriteFile permissions to be 0644.
41+
importas:
42+
# Do not allow unaliased imports of aliased packages.
43+
no-unaliased: true
44+
revive:
45+
rules:
46+
- name: package-comments
47+
disabled: true
48+
staticcheck:
49+
# All SA checks are enabled by default, customize as needed.
50+
# Refer to https://staticcheck.io/docs/checks for check details.
51+
checks:
52+
- all
53+
- '-SA1012' # Allow passing nil contexts.
54+
- '-ST1003' # Example of disabling another check if needed
1955

20-
run:
21-
concurrency: 4
22-
modules-download-mode: vendor
23-
24-
skip-dirs:
25-
- hack
26-
27-
linters-settings:
28-
staticcheck:
29-
checks:
30-
- all
31-
- '-SA1012' # Allow passing nil contexts.
32-
33-
importas:
34-
# Do not allow unaliased imports of aliased packages.
35-
no-unaliased: true
36-
37-
maligned:
38-
suggest-new: true
39-
40-
depguard:
41-
rules:
42-
main:
43-
deny:
44-
- pkg: io/ioutil
45-
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
46-
- pkg: "github.com/stretchr/testify/assert"
47-
desc: Use "gotest.tools/v3/assert" instead
48-
- pkg: "github.com/stretchr/testify/require"
49-
desc: Use "gotest.tools/v3/assert" instead
50-
- pkg: "github.com/stretchr/testify/suite"
51-
desc: Do not use
52-
53-
revive:
54-
rules:
55-
- name: package-comments
56-
disabled: true
57-
58-
gosec:
59-
excludes:
60-
- G306 # Allow WriteFile permissions to be 0644.
56+
# Exclusions based on common patterns and presets.
57+
exclusions:
58+
# Treat generated files leniently.
59+
generated: lax
60+
# Use predefined sets of common exclusions.
61+
presets:
62+
- comments
63+
- common-false-positives
64+
- legacy # Excludes checks deprecated in new Go versions
65+
- std-error-handling # Excludes some common stdlib error patterns
66+
# Exclude specific paths using regex.
67+
paths:
68+
- third_party$
69+
- builtin$
70+
- examples$
6171

72+
# Issues reporting configuration.
6273
issues:
6374
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
6475
max-issues-per-linter: 0
65-
6676
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
6777
max-same-issues: 0
78+
79+
# Formatters configuration (new in V2).
80+
formatters:
81+
enable:
82+
- goimports # Enable goimports as a formatter.
83+
exclusions:
84+
# Treat generated files leniently for formatting.
85+
generated: lax
86+
# Exclude specific paths from formatting using regex.
87+
paths:
88+
- third_party$
89+
- builtin$
90+
- examples$

app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func (a *App) Setup() {
190190
a.Action = helpCommand.Action
191191
}
192192

193-
if a.Compiled == (time.Time{}) {
193+
if a.Compiled.Equal(time.Time{}) {
194194
a.Compiled = compileTime()
195195
}
196196

app_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2761,7 +2761,7 @@ func TestFlagAction(t *testing.T) {
27612761
if v[0] == "err" {
27622762
return fmt.Errorf("error string slice")
27632763
}
2764-
_, err := c.App.Writer.Write([]byte(fmt.Sprintf("%v ", v)))
2764+
_, err := fmt.Fprintf(c.App.Writer, "%v ", v)
27652765
return err
27662766
},
27672767
},
@@ -2771,7 +2771,7 @@ func TestFlagAction(t *testing.T) {
27712771
if !v {
27722772
return fmt.Errorf("value is false")
27732773
}
2774-
_, err := c.App.Writer.Write([]byte(fmt.Sprintf("%t ", v)))
2774+
_, err := fmt.Fprintf(c.App.Writer, "%t ", v)
27752775
return err
27762776
},
27772777
},
@@ -2801,7 +2801,7 @@ func TestFlagAction(t *testing.T) {
28012801
if len(v) > 0 && v[0] < 0 {
28022802
return fmt.Errorf("invalid float64 slice")
28032803
}
2804-
_, err := c.App.Writer.Write([]byte(fmt.Sprintf("%v ", v)))
2804+
_, err := fmt.Fprintf(c.App.Writer, "%v ", v)
28052805
return err
28062806
},
28072807
},
@@ -2817,7 +2817,7 @@ func TestFlagAction(t *testing.T) {
28172817
}
28182818
}
28192819

2820-
_, err := c.App.Writer.Write([]byte(fmt.Sprintf("%v ", v)))
2820+
_, err := fmt.Fprintf(c.App.Writer, "%v ", v)
28212821
return err
28222822
},
28232823
},
@@ -2827,7 +2827,7 @@ func TestFlagAction(t *testing.T) {
28272827
if v < 0 {
28282828
return fmt.Errorf("negative int")
28292829
}
2830-
_, err := c.App.Writer.Write([]byte(fmt.Sprintf("%v ", v)))
2830+
_, err := fmt.Fprintf(c.App.Writer, "%v ", v)
28312831
return err
28322832
},
28332833
},
@@ -2837,7 +2837,7 @@ func TestFlagAction(t *testing.T) {
28372837
if len(v) > 0 && v[0] < 0 {
28382838
return fmt.Errorf("invalid int slice")
28392839
}
2840-
_, err := c.App.Writer.Write([]byte(fmt.Sprintf("%v ", v)))
2840+
_, err := fmt.Fprintf(c.App.Writer, "%v ", v)
28412841
return err
28422842
},
28432843
},
@@ -2847,7 +2847,7 @@ func TestFlagAction(t *testing.T) {
28472847
if v < 0 {
28482848
return fmt.Errorf("negative int64")
28492849
}
2850-
_, err := c.App.Writer.Write([]byte(fmt.Sprintf("%v ", v)))
2850+
_, err := fmt.Fprintf(c.App.Writer, "%v ", v)
28512851
return err
28522852
},
28532853
},
@@ -2857,7 +2857,7 @@ func TestFlagAction(t *testing.T) {
28572857
if len(v) > 0 && v[0] < 0 {
28582858
return fmt.Errorf("invalid int64 slice")
28592859
}
2860-
_, err := c.App.Writer.Write([]byte(fmt.Sprintf("%v ", v)))
2860+
_, err := fmt.Fprintf(c.App.Writer, "%v ", v)
28612861
return err
28622862
},
28632863
},
@@ -2867,7 +2867,7 @@ func TestFlagAction(t *testing.T) {
28672867
if v == "" {
28682868
return fmt.Errorf("empty path")
28692869
}
2870-
_, err := c.App.Writer.Write([]byte(fmt.Sprintf("%v ", v)))
2870+
_, err := fmt.Fprintf(c.App.Writer, "%v ", v)
28712871
return err
28722872
},
28732873
},
@@ -2888,7 +2888,7 @@ func TestFlagAction(t *testing.T) {
28882888
if v == 0 {
28892889
return fmt.Errorf("zero uint")
28902890
}
2891-
_, err := c.App.Writer.Write([]byte(fmt.Sprintf("%v ", v)))
2891+
_, err := fmt.Fprintf(c.App.Writer, "%v ", v)
28922892
return err
28932893
},
28942894
},
@@ -2898,7 +2898,7 @@ func TestFlagAction(t *testing.T) {
28982898
if len(v) > 0 && v[0] == 0 {
28992899
return fmt.Errorf("invalid uint slice")
29002900
}
2901-
_, err := c.App.Writer.Write([]byte(fmt.Sprintf("%v ", v)))
2901+
_, err := fmt.Fprintf(c.App.Writer, "%v ", v)
29022902
return err
29032903
},
29042904
},
@@ -2908,7 +2908,7 @@ func TestFlagAction(t *testing.T) {
29082908
if v == 0 {
29092909
return fmt.Errorf("zero uint64")
29102910
}
2911-
_, err := c.App.Writer.Write([]byte(fmt.Sprintf("%v ", v)))
2911+
_, err := fmt.Fprintf(c.App.Writer, "%v ", v)
29122912
return err
29132913
},
29142914
},
@@ -2918,7 +2918,7 @@ func TestFlagAction(t *testing.T) {
29182918
if len(v) > 0 && v[0] == 0 {
29192919
return fmt.Errorf("invalid uint64 slice")
29202920
}
2921-
_, err := c.App.Writer.Write([]byte(fmt.Sprintf("%v ", v)))
2921+
_, err := fmt.Fprintf(c.App.Writer, "%v ", v)
29222922
return err
29232923
},
29242924
},

cmd/urfave-cli-genflags/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module github.com/aperturerobotics/cli/cmd/urfave-cli-genflags
22

3-
go 1.24
3+
go 1.24.0
44

55
replace github.com/aperturerobotics/cli => ../../
66

77
require (
88
github.com/aperturerobotics/cli v1.0.0
9-
golang.org/x/text v0.23.0
9+
golang.org/x/text v0.30.0
1010
gopkg.in/yaml.v3 v3.0.1
1111
)
1212

cmd/urfave-cli-genflags/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
66
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
77
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
88
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
9+
golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k=
10+
golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
911
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1012
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
1113
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

command.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ func (c *Command) FullName() string {
100100
return strings.Join(c.commandNamePath, " ")
101101
}
102102

103-
func (cmd *Command) Command(name string) *Command {
104-
for _, c := range cmd.Subcommands {
103+
func (c *Command) Command(name string) *Command {
104+
for _, c := range c.Subcommands {
105105
if c.HasName(name) {
106106
return c
107107
}

0 commit comments

Comments
 (0)