Skip to content

Commit

Permalink
fix linters
Browse files Browse the repository at this point in the history
  • Loading branch information
ValyaB committed Sep 18, 2024
1 parent 6a57b07 commit 23d851f
Show file tree
Hide file tree
Showing 22 changed files with 137 additions and 568 deletions.
50 changes: 49 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,60 @@ linters:
- whitespace

linters-settings:
gocritic:
enabled-all: true
disabled-checks:
- commentFormatting
godot:
scope: all
gofumpt:
extra-rules: true
goconst:
min-len: 2
min-occurrences: 5
golint:
min-confidence: 0
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks: [argument,case,condition,return]
govet:
# shadow is marked as experimental feature, skip it for now.
check-shadowing: false
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
lll:
line-length: 200
maligned:
suggest-new: true
misspell:
locale: US
revive:
rules:
- name: redefines-builtin-id
disabled: true

# Allow code like:
# Items: binpacking.Items{
# {
# },
# }
- name: nested-structs
disabled: true
gci:
sections:
- standard
- default
- prefix(cloud-proxy)

issues:
fix: true
run:
skip-dirs:
- mock
- internal/castai
8 changes: 4 additions & 4 deletions cmd/proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func main() {

dialOpts := make([]grpc.DialOption, 0)
if cfg.CastAI.DisableGRPCTLS {
// ONLY For testing purposes
// ONLY For testing purposes.
dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials()))
} else {
dialOpts = append(dialOpts, grpc.WithTransportCredentials(credentials.NewTLS(nil)))
Expand Down Expand Up @@ -72,11 +72,11 @@ func main() {
}(conn)

ctx := metadata.NewOutgoingContext(context.Background(), metadata.Pairs(
"authorization", fmt.Sprintf("Token %s", cfg.CastAI.ApiKey),
"authorization", fmt.Sprintf("Token %s", cfg.CastAI.APIKey),
))

client := proxy.New(conn, gcp.New(gcpauth.NewCredentialsSource(), http.DefaultClient), logger,
cfg.ClusterID, GetVersion(), cfg.KeepAlive, cfg.KeepAliveTimeout)
cfg.GetPodName(), cfg.ClusterID, GetVersion(), cfg.KeepAlive, cfg.KeepAliveTimeout)
err = client.Run(ctx)
if err != nil {
logger.Panicf("Failed to run client: %v", err)
Expand All @@ -93,7 +93,7 @@ func setupLogger(cfg config.Config) *logrus.Logger {
logger.SetLevel(logrus.Level(cfg.Log.Level))
logger.SetReportCaller(true)
logger.Formatter = &logrus.TextFormatter{
CallerPrettyfier: func(f *runtime.Frame) (function string, file string) {
CallerPrettyfier: func(f *runtime.Frame) (function, file string) {
filename := path.Base(f.File)
return fmt.Sprintf("%s()", f.Function), fmt.Sprintf("%s:%d", filename, f.Line)
},
Expand Down
4 changes: 0 additions & 4 deletions e2e/Dockerfile

This file was deleted.

23 changes: 0 additions & 23 deletions e2e/chart/.helmignore

This file was deleted.

24 changes: 0 additions & 24 deletions e2e/chart/Chart.yaml

This file was deleted.

62 changes: 0 additions & 62 deletions e2e/chart/templates/_helpers.tpl

This file was deleted.

22 changes: 0 additions & 22 deletions e2e/chart/templates/job.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions e2e/chart/templates/service.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions e2e/chart/values.yaml

This file was deleted.

61 changes: 0 additions & 61 deletions e2e/main.go

This file was deleted.

Loading

0 comments on commit 23d851f

Please sign in to comment.