Skip to content

Commit

Permalink
fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnester committed Dec 16, 2024
1 parent e22fa0b commit 5a6814b
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion bundle/apps/upload_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

func TestAppUploadConfig(t *testing.T) {
root := t.TempDir()
err := os.MkdirAll(filepath.Join(root, "my_app"), 0700)
err := os.MkdirAll(filepath.Join(root, "my_app"), 0o700)
require.NoError(t, err)

b := &bundle.Bundle{
Expand Down
3 changes: 1 addition & 2 deletions bundle/apps/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import (
"github.com/databricks/cli/libs/diag"
)

type validate struct {
}
type validate struct{}

func (v *validate) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnostics {
var diags diag.Diagnostics
Expand Down
4 changes: 0 additions & 4 deletions bundle/deploy/terraform/tfdyn/convert_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ func (appConverter) Convert(ctx context.Context, key string, vin dyn.Value, out
return err
}

if err != nil {
return err
}

// Add the converted resource to the output.
out.App[key] = vout.AsAny()

Expand Down
3 changes: 1 addition & 2 deletions bundle/deploy/terraform/tfdyn/convert_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func TestConvertApp(t *testing.T) {
var src = resources.App{
src := resources.App{
SourceCodePath: "./app",
Config: map[string]any{
"command": []string{"python", "app.py"},
Expand Down Expand Up @@ -95,5 +95,4 @@ func TestConvertApp(t *testing.T) {
},
},
}, out.Permissions["app_my_app"])

}
3 changes: 0 additions & 3 deletions bundle/run/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ func (a *appRunner) start(ctx context.Context) error {
}
logProgress(ctx, "App is starting...")
}).Get()

if err != nil {
return err
}
Expand Down Expand Up @@ -149,7 +148,6 @@ func (a *appRunner) deploy(ctx context.Context) error {
SourceCodePath: app.SourceCodePath,
},
})

// If deploy returns an error, then there's an active deployment in progress, wait for it to complete.
if err != nil {
return err
Expand All @@ -161,7 +159,6 @@ func (a *appRunner) deploy(ctx context.Context) error {
}
logProgress(ctx, ad.Status.Message)
}).Get()

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion bundle/tests/apps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,4 @@ func TestAppsOverride(t *testing.T) {
assert.Equal(t, "key", app.Resources[2].Secret.Key)
assert.Equal(t, "scope", app.Resources[2].Secret.Scope)
assert.Equal(t, "CAN_USE", string(app.Resources[2].Secret.Permission))

}
4 changes: 2 additions & 2 deletions integration/bundle/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func runResource(t testutil.TestingT, ctx context.Context, path, key string) (st
return stdout.String(), err
}

func runResourceWithStderr(t testutil.TestingT, ctx context.Context, path string, key string) (string, string, error) {
func runResourceWithStderr(t testutil.TestingT, ctx context.Context, path, key string) (string, string, error) {
ctx = env.Set(ctx, "BUNDLE_ROOT", path)
ctx = cmdio.NewContext(ctx, cmdio.Default())

Expand All @@ -125,7 +125,7 @@ func runResourceWithStderr(t testutil.TestingT, ctx context.Context, path string
return stdout.String(), stderr.String(), err
}

func runResourceWithParams(t testutil.TestingT, ctx context.Context, path string, key string, params ...string) (string, error) {
func runResourceWithParams(t testutil.TestingT, ctx context.Context, path, key string, params ...string) (string, error) {
ctx = env.Set(ctx, "BUNDLE_ROOT", path)
ctx = cmdio.NewContext(ctx, cmdio.Default())

Expand Down
6 changes: 3 additions & 3 deletions libs/dyn/merge/elements_by_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type elementsByKey struct {
keyFunc func(dyn.Value) string
}

func (e elementsByKey) doMap(_ dyn.Path, v dyn.Value, mergeFunc func(a dyn.Value, b dyn.Value) (dyn.Value, error)) (dyn.Value, error) {
func (e elementsByKey) doMap(_ dyn.Path, v dyn.Value, mergeFunc func(a, b dyn.Value) (dyn.Value, error)) (dyn.Value, error) {
// We know the type of this value is a sequence.
// For additional defence, return self if it is not.
elements, ok := v.AsSequence()
Expand Down Expand Up @@ -60,15 +60,15 @@ func (e elementsByKey) Map(_ dyn.Path, v dyn.Value) (dyn.Value, error) {
}

func (e elementsByKey) MapWithOverride(p dyn.Path, v dyn.Value) (dyn.Value, error) {
return e.doMap(nil, v, func(a dyn.Value, b dyn.Value) (dyn.Value, error) {
return e.doMap(nil, v, func(a, b dyn.Value) (dyn.Value, error) {
return Override(a, b, OverrideVisitor{
VisitInsert: func(_ dyn.Path, v dyn.Value) (dyn.Value, error) {
return v, nil
},
VisitDelete: func(valuePath dyn.Path, left dyn.Value) error {
return nil
},
VisitUpdate: func(_ dyn.Path, a dyn.Value, b dyn.Value) (dyn.Value, error) {
VisitUpdate: func(_ dyn.Path, a, b dyn.Value) (dyn.Value, error) {
return b, nil
},
})
Expand Down

0 comments on commit 5a6814b

Please sign in to comment.