Skip to content

Commit

Permalink
chore: bump up golangci-lint version
Browse files Browse the repository at this point in the history
Signed-off-by: Binbin Li <[email protected]>
  • Loading branch information
binbin-li committed Dec 2, 2024
1 parent 6a719c9 commit 2939d3c
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
version: v1.59.1
version: v1.62.2
args: --timeout=10m
2 changes: 1 addition & 1 deletion cmd/ratify/cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func serve(opts serveCmdOptions) error {
if err != nil {
return err
}
logrus.Infof("starting server at" + opts.httpServerAddress)
logrus.Infof("starting server at %s", opts.httpServerAddress)

Check warning on line 121 in cmd/ratify/cmd/serve.go

View check run for this annotation

Codecov / codecov/patch

cmd/ratify/cmd/serve.go#L121

Added line #L121 was not covered by tests
if err := server.Run(nil); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/certificateprovider/certificate_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestDecodeCertificates_ByteArrayToCertificates(t *testing.T) {

r, err := DecodeCertificates(c1)
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

expectedLen := 1
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (sink *LogrusSink) createEntry(keysAndValues ...interface{}) *logrus.Entry
}

func (sink *LogrusSink) formatMessage(msg string) string {
if sink.names == nil || len(sink.names) == 0 {
if len(sink.names) == 0 {
return msg
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/keymanagementprovider/keymanagementprovider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func TestDecodeCertificates_ByteArrayToCertificates(t *testing.T) {

r, err := DecodeCertificates(c1)
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

expectedLen := 1
Expand Down
2 changes: 1 addition & 1 deletion pkg/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func StartServer(httpServerAddress, configFilePath, certDirectory, caCertFile st
logrus.Errorf("initialize server failed with error %v, exiting..", err)
os.Exit(1)
}
logrus.Infof("starting server at" + httpServerAddress)
logrus.Infof("starting server at %s", httpServerAddress)

Check warning on line 108 in pkg/manager/manager.go

View check run for this annotation

Codecov / codecov/patch

pkg/manager/manager.go#L108

Added line #L108 was not covered by tests
if err := server.Run(certRotatorReady); err != nil {
logrus.Errorf("starting server failed with error %v, exiting..", err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion pkg/verifier/notation/truststore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func TestGetCertificates_ErrorFromKMPReconcile(t *testing.T) {
}
store, err := newTrustStore(nil, certStore)
if err != nil {
t.Fatalf("failed to parse verificationCertStores: " + err.Error())
t.Fatalf("failed to parse verificationCertStores: %s", err.Error())
}

controllers.NamespacedCertStores = &mockCertStores{
Expand Down
7 changes: 4 additions & 3 deletions pkg/verifier/result_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ limitations under the License.
package verifier

import (
"fmt"
"testing"

e "errors"

"github.com/ratify-project/ratify/errors"
)

Expand Down Expand Up @@ -47,15 +48,15 @@ func TestNewVerifierResult(t *testing.T) {
{
name: "error without detail",
message: testMsg1,
err: errors.ErrorCodeUnknown.WithError(fmt.Errorf(testErrReason)).WithRemediation(testRemediation),
err: errors.ErrorCodeUnknown.WithError(e.New(testErrReason)).WithRemediation(testRemediation),
expectedMsg: testMsg1,
expectedErrReason: testErrReason,
expectedRemediation: testRemediation,
},
{
name: "error with detail",
message: testMsg1,
err: errors.ErrorCodeUnknown.WithError(fmt.Errorf(testErrReason)).WithRemediation(testRemediation).WithDetail(testMsg2),
err: errors.ErrorCodeUnknown.WithError(e.New(testErrReason)).WithRemediation(testRemediation).WithDetail(testMsg2),
expectedMsg: testMsg2,
expectedErrReason: testErrReason,
expectedRemediation: testRemediation,
Expand Down
7 changes: 4 additions & 3 deletions pkg/verifier/types/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ limitations under the License.
package types

import (
"fmt"
"testing"

e "errors"

"github.com/ratify-project/ratify/errors"
)

Expand Down Expand Up @@ -47,15 +48,15 @@ func TestCreateVerifierResult(t *testing.T) {
{
name: "error without detail",
message: testMsg1,
err: errors.ErrorCodeUnknown.WithError(fmt.Errorf(testErrReason)).WithRemediation(testRemediation),
err: errors.ErrorCodeUnknown.WithError(e.New(testErrReason)).WithRemediation(testRemediation),
expectedMsg: testMsg1,
expectedErrReason: testErrReason,
expectedRemediation: testRemediation,
},
{
name: "error with detail",
message: testMsg1,
err: errors.ErrorCodeUnknown.WithError(fmt.Errorf(testErrReason)).WithRemediation(testRemediation).WithDetail(testMsg2),
err: errors.ErrorCodeUnknown.WithError(e.New(testErrReason)).WithRemediation(testRemediation).WithDetail(testMsg2),
expectedMsg: testMsg2,
expectedErrReason: testErrReason,
expectedRemediation: testRemediation,
Expand Down

0 comments on commit 2939d3c

Please sign in to comment.