Skip to content

Commit

Permalink
Merge pull request #367 from invidian/update-linter
Browse files Browse the repository at this point in the history
Update golangci-lint to latest version v1.55.0
  • Loading branch information
invidian authored Oct 20, 2023
2 parents 680691a + af2d761 commit 7fe4a51
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: golangci/golangci-lint:v1.54.2
container: golangci/golangci-lint:v1.55.0
steps:
- uses: actions/cache@v2
with:
Expand Down
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ linters:
- gocheckcompilerdirectives
- gochecknoglobals
- gochecknoinits
- gochecksumtype
- gocognit
- goconst
- gocritic
Expand All @@ -134,6 +135,7 @@ linters:
- gosmopolitan
- grouper
- importas
- inamedparam
- ineffassign
- interfacebloat
- lll
Expand All @@ -152,18 +154,22 @@ linters:
- nonamedreturns
- nosprintfhostport
- paralleltest
- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- sqlclosecheck
- stylecheck
- tagalign
- tagliatelle
- tenv
- testableexamples
- testifylint
- thelper
- tparallel
- unconvert
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ tests on old version in the future.
- `flexkube` CLI will now print colored diff when configuration changes are detected.
- `flexkube` CLI will now ask user for confirmation before deploying the resources, unless `--yes` flag is set.
- `flexkube` CLI now supports `--noop` flag, which allows only checking if the configuration is up to date, without triggering the deployment.
- `flexkube` CLI now supports `conatiners` sub-command for managing arbitrary groups of containers. This allows to also manage some extra containers not provided by `libflexkube`.
- `flexkube` CLI now supports `containers` sub-command for managing arbitrary groups of containers. This allows to also manage some extra containers not provided by `libflexkube`.
- `pkg/kubelet` now supports waiting until node gets into ready state, if `WaitForNodeReady` flag is set to `true`.
- `kube-apiserver` from static controlplane now use `--target-ram-mb` flag to limit memory usage of bootstrap controlplane.

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GORUN=$(GOCMD) run
GOBUILD=$(GOCMD) build -v -ldflags $(LD_FLAGS) -trimpath

CC_TEST_REPORTER_ID=6e107e510c5479f40b0ce9166a254f3f1ee0bc547b3e48281bada1a5a32bb56d
GOLANGCI_LINT_VERSION=v1.54.2
GOLANGCI_LINT_VERSION=v1.55.0
BIN_PATH=$$HOME/bin

GO_PACKAGES=./...
Expand Down
2 changes: 1 addition & 1 deletion e2e/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type e2eConfig struct {
func parseInt(t *testing.T, envVar string, defaultValue int) int {
t.Helper()

iRaw := util.PickString(os.Getenv(envVar), fmt.Sprintf("%d", defaultValue))
iRaw := util.PickString(os.Getenv(envVar), strconv.Itoa(defaultValue))

i, err := strconv.Atoi(iRaw)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ type Interface interface {
Runtime() runtime.Runtime

// SetRuntime allows overriding used container runtime.
SetRuntime(runtime.Runtime)
SetRuntime(newRuntime runtime.Runtime)

// SetStatus allows overriding container status.
SetStatus(types.ContainerStatus)
SetStatus(newStatus types.ContainerStatus)
}

// InstanceInterface represents operations, which can be executed on existing
Expand Down
2 changes: 1 addition & 1 deletion pkg/container/runtime/docker/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestNewClient(t *testing.T) {
t.Parallel()

// TODO does this kind of simple tests make sense? Integration tests calls the same thing
// anyway. Or maybe we should simply skip error checking in itegration tests to simplify them?
// anyway. Or maybe we should simply skip error checking in integration tests to simplify them?
c := &docker.Config{
ClientGetter: func(...client.Opt) (docker.Client, error) { return nil, nil },
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/container/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type Config interface {
GetAddress() string

// SetAddress allows to override, which URL will be used when talking to container runtime.
SetAddress(string)
SetAddress(newAddress string)

// New validates container runtime and returns object, which can be used to create containers etc.
New() (Runtime, error)
Expand Down
6 changes: 3 additions & 3 deletions pkg/helm/release/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ type Release interface {
ValidateChart() error

// Install installs configured release. If release already exists, error will be returned.
Install(context.Context) error
Install(ctx context.Context) error

// Upgrade upgrades configured release. If release does not exist, error will be returned.
Upgrade(context.Context) error
Upgrade(ctx context.Context) error

// InstallOrUpgrade either installs or upgrades the release, depends whether it exists or not.
InstallOrUpgrade(context.Context) error
InstallOrUpgrade(ctx context.Context) error

// Exists checks, if release exists. If cluster is not reachable, error is returned.
Exists() (bool, error)
Expand Down
4 changes: 2 additions & 2 deletions pkg/host/host_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package host

import (
"fmt"
"strconv"
"testing"

"github.com/flexkube/libflexkube/pkg/host/transport/direct"
Expand Down Expand Up @@ -68,7 +68,7 @@ func TestValidate(t *testing.T) {
for n, testCase := range cases {
testCase := testCase

t.Run(fmt.Sprintf("%d", n), func(t *testing.T) {
t.Run(strconv.Itoa(n), func(t *testing.T) {
t.Parallel()

err := testCase.Host.Validate()
Expand Down
4 changes: 2 additions & 2 deletions pkg/host/transport/ssh/defaults_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ssh_test

import (
"fmt"
"reflect"
"strconv"
"testing"

"github.com/flexkube/libflexkube/pkg/host/transport/ssh"
Expand Down Expand Up @@ -391,7 +391,7 @@ func TestBuildConfig(t *testing.T) { //nolint:funlen,maintidx // Just many test
for i, testCase := range cases {
testCase := testCase

t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
t.Run(strconv.Itoa(i), func(t *testing.T) {
t.Parallel()

if nc := ssh.BuildConfig(testCase.config, testCase.defaults); !reflect.DeepEqual(nc, testCase.result) {
Expand Down
5 changes: 3 additions & 2 deletions pkg/kubernetes/client/kubeconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package client_test

import (
"fmt"
"strconv"
"strings"
"testing"

Expand Down Expand Up @@ -151,7 +152,7 @@ func TestToYAMLStringNew(t *testing.T) { //nolint:funlen // Just many test cases
for n, testCase := range cases {
testCase := testCase

t.Run(fmt.Sprintf("%d", n), func(t *testing.T) {
t.Run(strconv.Itoa(n), func(t *testing.T) {
t.Parallel()

pki := utiltest.GeneratePKI(t)
Expand Down Expand Up @@ -250,7 +251,7 @@ func TestValidate(t *testing.T) { //nolint:funlen // There are just many test ca
for n, testCase := range cases {
testCase := testCase

t.Run(fmt.Sprintf("%d", n), func(t *testing.T) {
t.Run(strconv.Itoa(n), func(t *testing.T) {
t.Parallel()

pki := utiltest.GeneratePKI(t)
Expand Down

0 comments on commit 7fe4a51

Please sign in to comment.