Skip to content

Commit 7b564b3

Browse files
committed
ci: disable golangci-lint pkg cache temporarily
See golangci/golangci-lint-action#135 Signed-off-by: Leonardo Di Donato <[email protected]>
1 parent 9ed2a6c commit 7b564b3

File tree

15 files changed

+24
-21
lines changed

15 files changed

+24
-21
lines changed

.github/workflows/lint.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: actions/setup-go@v5
3333
with:
3434
go-version: "1.21"
35-
cache: false
35+
check-latest: true
3636

3737
- name: Verify the dependencies
3838
run: |
@@ -42,6 +42,9 @@ jobs:
4242
- name: Lint
4343
uses: golangci/golangci-lint-action@v4
4444
with:
45-
version: v1.54
45+
version: v1.57.1
4646
args: --timeout 20m0s --verbose --out-${IGNORE_FUTURE_WARNINGS}format tab
4747
only-new-issues: true # Show only new issues on pull requests
48+
# Disable caching as a workaround for https://github.com/golangci/golangci-lint-action/issues/135.
49+
# The line can be removed once the golangci-lint issue is resolved.
50+
skip-pkg-cache: true

cmd/in/in.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ The verdicts it returns are listed by the name of each package and its specified
9595
}
9696
// Fallback to reading the package-lock.json in the target directory
9797
if packageLockJSONErr != nil || !inOpts.GenerateLock {
98-
packageLockJSON, packageLockJSONErr = npm.GetPackageLockJsonFromDir(targetDir)
98+
packageLockJSON, packageLockJSONErr = npm.GetPackageLockJSONFromDir(targetDir)
9999
}
100100
if packageLockJSONErr != nil {
101101
return packageLockJSONErr

cmd/root/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func New(ctx context.Context) (*Command, error) {
7575
Annotations: map[string]string{
7676
"source": project.GetSourceURL(filename),
7777
},
78-
PersistentPreRunE: func(c *cobra.Command, args []string) error {
78+
PersistentPreRunE: func(c *cobra.Command, _ []string) error {
7979
// Do not check for the config file if the command is not available (eg., help) or not core (eg., version)
8080
withConfigFile := false
8181
c, _, err := c.Find(os.Args[1:])
@@ -240,7 +240,7 @@ func New(ctx context.Context) (*Command, error) {
240240

241241
return nil
242242
},
243-
PersistentPostRunE: func(c *cobra.Command, args []string) error {
243+
PersistentPostRunE: func(c *cobra.Command, _ []string) error {
244244
contextCancel, ok := c.Context().Value(pkgcontext.ContextCancelFuncKey).(context.CancelFunc)
245245
if !ok {
246246
return fmt.Errorf("couldn't obtain configuration options")

cmd/version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func New(ctx context.Context) (*cobra.Command, error) {
3939
Annotations: map[string]string{
4040
"source": project.GetSourceURL(filename),
4141
},
42-
RunE: func(c *cobra.Command, args []string) error {
42+
RunE: func(c *cobra.Command, _ []string) error {
4343
ctx = c.Context()
4444

4545
// Obtain the local options from the context

make/docs/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func getManpages(ctx context.Context) *cobra.Command {
4646
SilenceUsage: true,
4747
DisableFlagsInUseLine: true,
4848
Short: "Generate lstn manpages.",
49-
RunE: func(c *cobra.Command, args []string) error {
49+
RunE: func(_ *cobra.Command, _ []string) error {
5050
rootFlagValues, ok := ctx.Value(rootFlagsKey).(*rootFlags)
5151
if !ok {
5252
return fmt.Errorf("couldn't obtain the flag values from the context")
@@ -68,7 +68,7 @@ func newRoot(ctx context.Context) error {
6868
SilenceUsage: true,
6969
Short: "Generate lstn documentation.",
7070
Args: cobra.ExactArgs(1),
71-
PersistentPreRunE: func(c *cobra.Command, args []string) error {
71+
PersistentPreRunE: func(_ *cobra.Command, _ []string) error {
7272
// Eventually validate rootF struct
7373

7474
return nil

pkg/cmd/flags/base_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func (suite *FlagsBaseSuite) TestValidate() {
103103
}
104104

105105
for _, tc := range cases {
106-
suite.T().Run(tc.desc, func(t *testing.T) {
106+
suite.T().Run(tc.desc, func(_ *testing.T) {
107107
actual := Validate(tc.o)
108108
assert.Equal(suite.T(), len(tc.expectedStr), len(actual))
109109
for _, a := range actual {

pkg/cmd/flags/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (o *ConfigFlags) SetDefaults() {
107107
}
108108
if defaults.CanUpdate(o.Reporting.Types) {
109109
// Create the enum flag value for --reporter
110-
enumValues := goneric.MapToSlice(func(t cmd.ReportType, v []string) string {
110+
enumValues := goneric.MapToSlice(func(_ cmd.ReportType, v []string) string {
111111
return v[0]
112112
}, cmd.ReporterTypeIDs)
113113
sort.Strings(enumValues)

pkg/cmd/flags/json_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,21 @@ func (suite *FlagsJSONSuite) TestQuery() {
4545
}
4646

4747
func (suite *FlagsJSONSuite) TestOutput() {
48-
suite.T().Run("Failure", func(t *testing.T) {
48+
suite.T().Run("Failure", func(_ *testing.T) {
4949
i := &JSONFlags{JSON: false, JQ: "."}
5050
input := bytes.NewReader([]byte("{\"key\":\"value\"}"))
5151
var output bytes.Buffer
5252
assert.EqualError(suite.T(), i.GetOutput(context.Background(), input, &output), "cannot output JSON")
5353
})
5454
suite.T().Run("Success", func(t *testing.T) {
55-
t.Run("QueryGetAll", func(t *testing.T) {
55+
t.Run("QueryGetAll", func(_ *testing.T) {
5656
i := &JSONFlags{JSON: true, JQ: "."}
5757
input := bytes.NewReader([]byte("{\"key\":\"value\"}"))
5858
var output bytes.Buffer
5959
assert.NoError(suite.T(), i.GetOutput(context.Background(), input, &output))
6060
assert.Equal(suite.T(), "{\"key\":\"value\"}\n", output.String())
6161
})
62-
t.Run("QueryGetValue", func(t *testing.T) {
62+
t.Run("QueryGetValue", func(_ *testing.T) {
6363
i := &JSONFlags{JSON: true, JQ: ".key"}
6464
input := bytes.NewReader([]byte("{\"key\":\"value\"}"))
6565
var output bytes.Buffer

pkg/cmd/help/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
)
2828

2929
func configHelpTopicFunc() TopicFunc {
30-
return func(c *cobra.Command, args []string) {
30+
return func(c *cobra.Command, _ []string) {
3131
b := bytes.NewBufferString("# lstn configuration file\n\n")
3232
fmt.Fprintf(b, "%s\n\n", "The `lstn` CLI looks for a configuration file .lstn.yaml in your `$HOME` directory when it starts.")
3333
fmt.Fprintf(b, "%s\n", "In this file you can set the values for the global `lstn` configurations.")

pkg/cmd/help/environment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
)
2727

2828
func envHelpTopicFunc() TopicFunc {
29-
return func(c *cobra.Command, args []string) {
29+
return func(c *cobra.Command, _ []string) {
3030
b := bytes.NewBufferString("# lstn environment variables\n\n")
3131
fmt.Fprintf(b, "%s\n\n", "The environment variables override any corresponding configuration setting.")
3232
fmt.Fprintf(b, "%s\n\n", "But flags override them.")

pkg/cmd/help/manual.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func cReference(w io.Writer, c *cobra.Command, depth int) {
9191
}
9292

9393
func manualHelpTopicFunc() TopicFunc {
94-
return func(c *cobra.Command, args []string) {
94+
return func(c *cobra.Command, _ []string) {
9595
b := bytes.NewBufferString("# lstn cheatsheet\n\n")
9696

9797
// NOTE > Assuming c.Parent() is the root one

pkg/cmd/help/reporters.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
)
2525

2626
func reportersHelpTopicFunc() TopicFunc {
27-
return func(c *cobra.Command, args []string) {
27+
return func(c *cobra.Command, _ []string) {
2828
b := bytes.NewBufferString("# lstn reporters\n\n")
2929

3030
for _, reportType := range cmd.AllReportTypes {

pkg/listen/types_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ func (suite *TypesSuite) TestResponseMarshalJSON() {
540540

541541
for _, tc := range cases {
542542
r := new(Response)
543-
t.Run(tc.desc, func(t *testing.T) {
543+
t.Run(tc.desc, func(_ *testing.T) {
544544
dec := json.NewDecoder(tc.reader)
545545
suite.NoError(dec.Decode(r))
546546
suite.Equal(*r, tc.expected)

pkg/npm/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ func NewPackageLockJSONFromBytes(b []byte) (PackageLockJSON, error) {
202202
return ret, nil
203203
}
204204

205-
// GetPackageLockJsonFromDir creates a PackageLockJSON instance from the existing package-lock.json in dir, if any.
206-
func GetPackageLockJsonFromDir(dir string) (PackageLockJSON, error) {
205+
// GetPackageLockJSONFromDir creates a PackageLockJSON instance from the existing package-lock.json in dir, if any.
206+
func GetPackageLockJSONFromDir(dir string) (PackageLockJSON, error) {
207207
reader, err := read(dir, "package-lock.json")
208208
if err != nil {
209209
return nil, err

pkg/transform/transform.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func init() {
3333
Singleton = modifiers.New()
3434
Singleton.SetTagName("transform")
3535

36-
Singleton.Register("unique", func(ctx context.Context, fl mold.FieldLevel) error {
36+
Singleton.Register("unique", func(_ context.Context, fl mold.FieldLevel) error {
3737
if fl.Field().Kind() == reflect.Slice {
3838
unique := fl.Field().Interface()
3939
switch fl.Field().Type().Elem().String() {

0 commit comments

Comments
 (0)