Skip to content

Commit

Permalink
gci format files
Browse files Browse the repository at this point in the history
  • Loading branch information
CCOLLOT committed Dec 18, 2023
1 parent 1e4744c commit 61efbc6
Show file tree
Hide file tree
Showing 34 changed files with 50 additions and 45 deletions.
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
var (
debug bool

Check failure on line 11 in cmd/root.go

View workflow job for this annotation

GitHub Actions / lint

var `debug` is unused (unused)
configFilePath string
logLevel string
logFormat string
logLevel string
logFormat string
)

func InitAndRunCommand() error {
Expand Down
5 changes: 2 additions & 3 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cmd

import (
"fmt"
"log/slog"
"os"
"os/signal"
"syscall"
Expand All @@ -14,6 +13,7 @@ import (
"github.com/qonto/upgrade-manager/internal/build"
"github.com/qonto/upgrade-manager/internal/infra/http"
"github.com/qonto/upgrade-manager/internal/infra/kubernetes"
"log/slog"
)

func Run() error {
Expand All @@ -22,9 +22,8 @@ func Run() error {
if err != nil {
return err
}

logger := buildLogger(logLevel, logFormat)

logger := buildLogger(logLevel, logFormat)

logger.Info(build.VersionMessage())
signals := make(chan os.Signal, 1)
Expand Down
23 changes: 15 additions & 8 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package app
import (
"context"
"fmt"
"log/slog"
"os"
"sync"
"time"
Expand All @@ -29,6 +28,7 @@ import (
"github.com/qonto/upgrade-manager/internal/app/sources/filesystemhelm"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"github.com/qonto/upgrade-manager/internal/infra/kubernetes"
"log/slog"
)

type App struct {
Expand Down Expand Up @@ -109,7 +109,8 @@ func (a *App) InitSources() error {
softSource, err := argohelm.NewSource(item, a.log, a.k8sClient, true, a.s3Api)
if err != nil {
a.log.Error(fmt.Sprint(err))
os.Exit(1) }
os.Exit(1)
}
a.sources = append(a.sources, softSource)
}
}
Expand All @@ -118,43 +119,49 @@ func (a *App) InitSources() error {
softSource, err := deployments.NewSource(a.log, a.k8sClient, item)
if err != nil {
a.log.Error(fmt.Sprint(err))
os.Exit(1) }
os.Exit(1)
}
a.sources = append(a.sources, softSource)
}
}
if a.Config.Sources.Aws.Elasticache.Enabled {
escSource, err := elasticacheSource.NewSource(a.escApi, a.log, &a.Config.Sources.Aws.Elasticache)
if err != nil {
a.log.Error(fmt.Sprint(err))
os.Exit(1) }
os.Exit(1)
}
a.sources = append(a.sources, escSource)
}
if a.Config.Sources.Aws.Eks.Enabled {
eksSource, err := eksSource.NewSource(a.eksApi, a.log, &a.Config.Sources.Aws.Eks)
if err != nil {
a.log.Error(fmt.Sprint(err))
os.Exit(1) }
os.Exit(1)
}
a.sources = append(a.sources, eksSource)
}
if a.Config.Sources.Aws.Msk.Enabled {
mskSource, err := mskSource.NewSource(a.mskApi, a.log, &a.Config.Sources.Aws.Msk)
if err != nil {
a.log.Error(fmt.Sprint(err))
os.Exit(1) }
os.Exit(1)
}
a.sources = append(a.sources, mskSource)
}
if a.Config.Sources.Aws.Rds.Enabled {
rdsSource, err := rdsSource.NewSource(a.rdsApi, a.log, &a.Config.Sources.Aws.Rds)
if err != nil {
a.log.Error(fmt.Sprint(err))
os.Exit(1) }
os.Exit(1)
}
a.sources = append(a.sources, rdsSource)
}
if a.Config.Sources.Aws.Lambda.Enabled {
lambdaSource, err := lambdaSource.NewSource(a.lambdaApi, a.log, &a.Config.Sources.Aws.Lambda)
if err != nil {
a.log.Error(fmt.Sprint(err))
os.Exit(1) }
os.Exit(1)
}
a.sources = append(a.sources, lambdaSource)
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion internal/app/calculators/candidate_count_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package calculators

import (

Check failure on line 3 in internal/app/calculators/candidate_count_test.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default (gci)
"log/slog"
"testing"

Check failure on line 5 in internal/app/calculators/candidate_count_test.go

View workflow job for this annotation

GitHub Actions / lint

File is not `goimports`-ed (goimports)
"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/stretchr/testify/assert"
"log/slog"
)

func TestCandidateCountCalculateObsolescence(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/calculators/date_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package calculators

import (
"log/slog"
"testing"
"time"

s "github.com/qonto/upgrade-manager/internal/app/core/software"

Check failure on line 7 in internal/app/calculators/date_test.go

View workflow job for this annotation

GitHub Actions / lint

File is not `goimports`-ed (goimports)
"log/slog"
)

func TestDateCalculateObsolescenceScore(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/calculators/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package calculators

import (
"fmt"
"log/slog"

Check failure on line 5 in internal/app/calculators/default.go

View workflow job for this annotation

GitHub Actions / lint

File is not `goimports`-ed (goimports)
goversion "github.com/hashicorp/go-version"
soft "github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/app/semver"
"log/slog"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/app/calculators/default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package calculators

import (
"fmt"
"log/slog"
"testing"

s "github.com/qonto/upgrade-manager/internal/app/core/software"
"log/slog"
)

func TestCalculateObsolescenceScore(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions internal/app/calculators/meta.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package calculators

import (
"log/slog"

"github.com/qonto/upgrade-manager/internal/app/core/software"
"log/slog"
)

var calculatorCache = make(map[software.CalculatorType]software.Calculator)
Expand Down
2 changes: 1 addition & 1 deletion internal/app/calculators/meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package calculators

import (
"fmt"

Check failure on line 4 in internal/app/calculators/meta_test.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default (gci)
"log/slog"
"testing"

s "github.com/qonto/upgrade-manager/internal/app/core/software"
"log/slog"

Check failure on line 8 in internal/app/calculators/meta_test.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default (gci)
)

func TestMetaCalculateObsolescenceScore(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/argohelm/git_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package argohelm
import (
"context"
"fmt"
"log/slog"
"regexp"
"strconv"
"time"
Expand All @@ -12,6 +11,7 @@ import (
"github.com/go-git/go-git/v5/plumbing/transport/ssh"
"github.com/qonto/upgrade-manager/internal/app/sources/utils/gitutils"
k8sClient "github.com/qonto/upgrade-manager/internal/infra/kubernetes"
"log/slog"
)

// Retrieve all git credentials in the namespace which have "repo" in their name
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/argohelm/git_credentials_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package argohelm

import (
"log/slog"
"os"
"regexp"
"testing"

"github.com/qonto/upgrade-manager/internal/infra/kubernetes"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"log/slog"
)

func TestGetGitCredentialSecretsFromNamespace(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/argohelm/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package argohelm
import (
"context"
"fmt"
"log/slog"
"os"
"regexp"
"strconv"
Expand All @@ -19,6 +18,7 @@ import (
"github.com/qonto/upgrade-manager/internal/infra/aws"
"github.com/qonto/upgrade-manager/internal/infra/kubernetes"
"helm.sh/helm/v3/pkg/chart"
"log/slog"
)

const ArgoHelm soft.SoftwareType = "argoHelm"
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/argohelm/source_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package argohelm

import (
"log/slog"
"testing"

"github.com/go-git/go-git/v5/plumbing/transport/http"
"github.com/qonto/upgrade-manager/internal/app/sources/utils/gitutils"
"log/slog"
)

func TestMatchGitRepoConnection(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/eks/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package eks
import (
"context"
"fmt"
"log/slog"
"time"

"github.com/aws/aws-sdk-go-v2/service/eks"
"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/app/filters"
"github.com/qonto/upgrade-manager/internal/app/semver"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

type Source struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/eks/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package eks

import (
"fmt"
"log/slog"
"testing"

"github.com/aws/aws-sdk-go-v2/aws"
Expand All @@ -11,6 +10,7 @@ import (
"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/app/filters"
awsInfra "github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

func TestLoad(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/elasticache/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package elasticache

import (
"context"
"log/slog"
"time"

"github.com/aws/aws-sdk-go-v2/service/elasticache"
"github.com/aws/aws-sdk-go-v2/service/elasticache/types"
"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/app/filters"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

type VersionProvider struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/elasticache/provider_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package elasticache

import (
"log/slog"
"testing"

"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/app/filters"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

func TestLoad(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/elasticache/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package elasticache
import (
"context"
"fmt"
"log/slog"
"time"

"github.com/aws/aws-sdk-go-v2/service/elasticache"
"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/app/filters"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

type Source struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/elasticache/source_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package elasticache

import (
"log/slog"
"testing"

"github.com/qonto/upgrade-manager/internal/app/filters"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

func TestSourceLoad(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/lambda/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package lambda

import (
"context"
"log/slog"
"time"

"github.com/aws/aws-sdk-go-v2/service/lambda"
"github.com/aws/aws-sdk-go-v2/service/lambda/types"
"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

type Source struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/lambda/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package lambda

import (
"errors"
"log/slog"
"testing"

"github.com/aws/aws-sdk-go-v2/service/lambda"
Expand All @@ -12,6 +11,7 @@ import (
"github.com/qonto/upgrade-manager/internal/infra/aws"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"log/slog"
)

func TestLoad(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/msk/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package msk

import (
"context"
"log/slog"
"strings"
"time"

"github.com/aws/aws-sdk-go-v2/service/kafka"
"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/app/filters"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

type Source struct {
Expand Down
Loading

0 comments on commit 61efbc6

Please sign in to comment.