Skip to content

Commit dd8b672

Browse files
committed
fixed lint
1 parent f568c88 commit dd8b672

File tree

8 files changed

+8
-18
lines changed

8 files changed

+8
-18
lines changed

bundle/apps/upload_config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020

2121
func TestAppUploadConfig(t *testing.T) {
2222
root := t.TempDir()
23-
err := os.MkdirAll(filepath.Join(root, "my_app"), 0700)
23+
err := os.MkdirAll(filepath.Join(root, "my_app"), 0o700)
2424
require.NoError(t, err)
2525

2626
b := &bundle.Bundle{

bundle/apps/validate.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import (
99
"github.com/databricks/cli/libs/diag"
1010
)
1111

12-
type validate struct {
13-
}
12+
type validate struct{}
1413

1514
func (v *validate) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnostics {
1615
var diags diag.Diagnostics

bundle/deploy/terraform/tfdyn/convert_app.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ func (appConverter) Convert(ctx context.Context, key string, vin dyn.Value, out
2929
return err
3030
}
3131

32-
if err != nil {
33-
return err
34-
}
35-
3632
// Add the converted resource to the output.
3733
out.App[key] = vout.AsAny()
3834

bundle/deploy/terraform/tfdyn/convert_app_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
)
1515

1616
func TestConvertApp(t *testing.T) {
17-
var src = resources.App{
17+
src := resources.App{
1818
SourceCodePath: "./app",
1919
Config: map[string]any{
2020
"command": []string{"python", "app.py"},
@@ -95,5 +95,4 @@ func TestConvertApp(t *testing.T) {
9595
},
9696
},
9797
}, out.Permissions["app_my_app"])
98-
9998
}

bundle/run/app.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ func (a *appRunner) start(ctx context.Context) error {
102102
}
103103
logProgress(ctx, "App is starting...")
104104
}).Get()
105-
106105
if err != nil {
107106
return err
108107
}
@@ -149,7 +148,6 @@ func (a *appRunner) deploy(ctx context.Context) error {
149148
SourceCodePath: app.SourceCodePath,
150149
},
151150
})
152-
153151
// If deploy returns an error, then there's an active deployment in progress, wait for it to complete.
154152
if err != nil {
155153
return err
@@ -161,7 +159,6 @@ func (a *appRunner) deploy(ctx context.Context) error {
161159
}
162160
logProgress(ctx, ad.Status.Message)
163161
}).Get()
164-
165162
if err != nil {
166163
return err
167164
}

bundle/tests/apps_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,4 @@ func TestAppsOverride(t *testing.T) {
5757
assert.Equal(t, "key", app.Resources[2].Secret.Key)
5858
assert.Equal(t, "scope", app.Resources[2].Secret.Scope)
5959
assert.Equal(t, "CAN_USE", string(app.Resources[2].Secret.Permission))
60-
6160
}

integration/bundle/helpers_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func runResource(t testutil.TestingT, ctx context.Context, path, key string) (st
119119
return stdout.String(), err
120120
}
121121

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

@@ -128,7 +128,7 @@ func runResourceWithStderr(t testutil.TestingT, ctx context.Context, path string
128128
return stdout.String(), stderr.String(), err
129129
}
130130

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

libs/dyn/merge/elements_by_key.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type elementsByKey struct {
77
keyFunc func(dyn.Value) string
88
}
99

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

6262
func (e elementsByKey) MapWithOverride(p dyn.Path, v dyn.Value) (dyn.Value, error) {
63-
return e.doMap(nil, v, func(a dyn.Value, b dyn.Value) (dyn.Value, error) {
63+
return e.doMap(nil, v, func(a, b dyn.Value) (dyn.Value, error) {
6464
return Override(a, b, OverrideVisitor{
6565
VisitInsert: func(_ dyn.Path, v dyn.Value) (dyn.Value, error) {
6666
return v, nil
6767
},
6868
VisitDelete: func(valuePath dyn.Path, left dyn.Value) error {
6969
return nil
7070
},
71-
VisitUpdate: func(_ dyn.Path, a dyn.Value, b dyn.Value) (dyn.Value, error) {
71+
VisitUpdate: func(_ dyn.Path, a, b dyn.Value) (dyn.Value, error) {
7272
return b, nil
7373
},
7474
})

0 commit comments

Comments
 (0)