Merge pull request #31861 from mmorel-35/nolintlint

fix: enable nolinlint linter
pull/31853/head
George Jenkins 7 months ago committed by GitHub
commit bd334848b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -25,6 +25,7 @@ linters:
- ineffassign - ineffassign
- misspell - misspell
- nakedret - nakedret
- nolintlint
- revive - revive
- sloglint - sloglint
- staticcheck - staticcheck
@ -67,6 +68,9 @@ linters:
dupl: dupl:
threshold: 400 threshold: 400
exhaustive:
default-signifies-exhaustive: true
gomodguard: gomodguard:
blocked: blocked:
modules: modules:
@ -74,8 +78,8 @@ linters:
recommendations: recommendations:
- github.com/evanphx/json-patch/v5 - github.com/evanphx/json-patch/v5
exhaustive: nolintlint:
default-signifies-exhaustive: true require-specific: true
run: run:
timeout: 10m timeout: 10m

@ -35,7 +35,7 @@ func TestLoadChartfile(t *testing.T) {
func verifyChartfile(t *testing.T, f *chart.Metadata, name string) { func verifyChartfile(t *testing.T, f *chart.Metadata, name string) {
t.Helper() t.Helper()
if f == nil { //nolint:staticcheck if f == nil {
t.Fatal("Failed verifyChartfile because f is nil") t.Fatal("Failed verifyChartfile because f is nil")
} }

@ -23,7 +23,7 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/ProtonMail/go-crypto/openpgp/clearsign" //nolint "github.com/ProtonMail/go-crypto/openpgp/clearsign"
"helm.sh/helm/v4/pkg/helmpath" "helm.sh/helm/v4/pkg/helmpath"
) )

@ -35,11 +35,11 @@ func TestLoadChartfile(t *testing.T) {
func verifyChartfile(t *testing.T, f *chart.Metadata, name string) { func verifyChartfile(t *testing.T, f *chart.Metadata, name string) {
t.Helper() t.Helper()
if f == nil { //nolint:staticcheck if f == nil {
t.Fatal("Failed verifyChartfile because f is nil") t.Fatal("Failed verifyChartfile because f is nil")
} }
if f.APIVersion != chart.APIVersionV1 { //nolint:staticcheck if f.APIVersion != chart.APIVersionV1 {
t.Errorf("Expected API Version %q, got %q", chart.APIVersionV1, f.APIVersion) t.Errorf("Expected API Version %q, got %q", chart.APIVersionV1, f.APIVersion)
} }

@ -583,10 +583,10 @@ func verifyInsecureSkipVerify(t *testing.T, g *HTTPGetter, caseName string, expe
t.Fatal(err) t.Fatal(err)
} }
if returnVal == nil { //nolint:staticcheck if returnVal == nil {
t.Fatalf("Expected non nil value for http client") t.Fatalf("Expected non nil value for http client")
} }
transport := (returnVal.Transport).(*http.Transport) //nolint:staticcheck transport := (returnVal.Transport).(*http.Transport)
gotValue := false gotValue := false
if transport.TLSClientConfig != nil { if transport.TLSClientConfig != nil {
gotValue = transport.TLSClientConfig.InsecureSkipVerify gotValue = transport.TLSClientConfig.InsecureSkipVerify
@ -607,11 +607,11 @@ func TestDefaultHTTPTransportReuse(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
if httpClient1 == nil { //nolint:staticcheck if httpClient1 == nil {
t.Fatalf("Expected non nil value for http client") t.Fatalf("Expected non nil value for http client")
} }
transport1 := (httpClient1.Transport).(*http.Transport) //nolint:staticcheck transport1 := (httpClient1.Transport).(*http.Transport)
httpClient2, err := g.httpClient(g.opts) httpClient2, err := g.httpClient(g.opts)
@ -619,11 +619,11 @@ func TestDefaultHTTPTransportReuse(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
if httpClient2 == nil { //nolint:staticcheck if httpClient2 == nil {
t.Fatalf("Expected non nil value for http client") t.Fatalf("Expected non nil value for http client")
} }
transport2 := (httpClient2.Transport).(*http.Transport) //nolint:staticcheck transport2 := (httpClient2.Transport).(*http.Transport)
if transport1 != transport2 { if transport1 != transport2 {
t.Fatalf("Expected default transport to be reused") t.Fatalf("Expected default transport to be reused")
@ -641,11 +641,11 @@ func TestHTTPTransportOption(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
if httpClient1 == nil { //nolint:staticcheck if httpClient1 == nil {
t.Fatalf("Expected non nil value for http client") t.Fatalf("Expected non nil value for http client")
} }
transport1 := (httpClient1.Transport).(*http.Transport) //nolint:staticcheck transport1 := (httpClient1.Transport).(*http.Transport)
if transport1 != transport { if transport1 != transport {
t.Fatalf("Expected transport option to be applied") t.Fatalf("Expected transport option to be applied")
@ -657,11 +657,11 @@ func TestHTTPTransportOption(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
if httpClient2 == nil { //nolint:staticcheck if httpClient2 == nil {
t.Fatalf("Expected non nil value for http client") t.Fatalf("Expected non nil value for http client")
} }
transport2 := (httpClient2.Transport).(*http.Transport) //nolint:staticcheck transport2 := (httpClient2.Transport).(*http.Transport)
if transport1 != transport2 { if transport1 != transport2 {
t.Fatalf("Expected applied transport to be reused") t.Fatalf("Expected applied transport to be reused")

@ -25,9 +25,9 @@ import (
"os" "os"
"strings" "strings"
"github.com/ProtonMail/go-crypto/openpgp" //nolint "github.com/ProtonMail/go-crypto/openpgp"
"github.com/ProtonMail/go-crypto/openpgp/clearsign" //nolint "github.com/ProtonMail/go-crypto/openpgp/clearsign"
"github.com/ProtonMail/go-crypto/openpgp/packet" //nolint "github.com/ProtonMail/go-crypto/openpgp/packet"
"sigs.k8s.io/yaml" "sigs.k8s.io/yaml"
) )

@ -24,8 +24,8 @@ import (
"strings" "strings"
"testing" "testing"
pgperrors "github.com/ProtonMail/go-crypto/openpgp/errors" //nolint pgperrors "github.com/ProtonMail/go-crypto/openpgp/errors"
"github.com/ProtonMail/go-crypto/openpgp/packet" //nolint "github.com/ProtonMail/go-crypto/openpgp/packet"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"sigs.k8s.io/yaml" "sigs.k8s.io/yaml"

@ -114,11 +114,11 @@ func TestRepoFile_Get(t *testing.T) {
name := "second" name := "second"
entry := repo.Get(name) entry := repo.Get(name)
if entry == nil { //nolint:staticcheck if entry == nil {
t.Fatalf("Expected repo entry %q to be found", name) t.Fatalf("Expected repo entry %q to be found", name)
} }
if entry.URL != "https://example.com/second" { //nolint:staticcheck if entry.URL != "https://example.com/second" {
t.Errorf("Expected repo URL to be %q but got %q", "https://example.com/second", entry.URL) t.Errorf("Expected repo URL to be %q but got %q", "https://example.com/second", entry.URL)
} }

Loading…
Cancel
Save