mirror of https://github.com/databricks/cli.git
Enable linter 'unconvert' and fix the issues found (#2136)
This commit is contained in:
parent
5d9bc3b553
commit
2b452973f3
|
@ -15,6 +15,7 @@ linters:
|
||||||
- intrange
|
- intrange
|
||||||
- mirror
|
- mirror
|
||||||
- perfsprint
|
- perfsprint
|
||||||
|
- unconvert
|
||||||
linters-settings:
|
linters-settings:
|
||||||
govet:
|
govet:
|
||||||
enable-all: true
|
enable-all: true
|
||||||
|
|
|
@ -44,6 +44,6 @@ func TestAppInterpolateVariables(t *testing.T) {
|
||||||
|
|
||||||
diags := bundle.Apply(context.Background(), b, InterpolateVariables())
|
diags := bundle.Apply(context.Background(), b, InterpolateVariables())
|
||||||
require.Empty(t, diags)
|
require.Empty(t, diags)
|
||||||
require.Equal(t, []any([]any{map[string]any{"name": "JOB_ID", "value": "123"}}), b.Config.Resources.Apps["my_app_1"].Config["env"])
|
require.Equal(t, []any{map[string]any{"name": "JOB_ID", "value": "123"}}, b.Config.Resources.Apps["my_app_1"].Config["env"])
|
||||||
require.Nil(t, b.Config.Resources.Apps["my_app_2"].Config)
|
require.Nil(t, b.Config.Resources.Apps["my_app_2"].Config)
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,7 +189,7 @@ func (l *Logger) writeJson(event Event) {
|
||||||
// we panic because there we cannot catch this in jobs.RunNowAndWait
|
// we panic because there we cannot catch this in jobs.RunNowAndWait
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
_, _ = l.Writer.Write([]byte(b))
|
_, _ = l.Writer.Write(b)
|
||||||
_, _ = l.Writer.Write([]byte("\n"))
|
_, _ = l.Writer.Write([]byte("\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ func (v Value) AsInt() (int64, bool) {
|
||||||
case int32:
|
case int32:
|
||||||
return int64(vv), true
|
return int64(vv), true
|
||||||
case int64:
|
case int64:
|
||||||
return int64(vv), true
|
return vv, true
|
||||||
default:
|
default:
|
||||||
return 0, false
|
return 0, false
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ func (f file) close() error {
|
||||||
func (f file) readHeader() (string, error) {
|
func (f file) readHeader() (string, error) {
|
||||||
// Scan header line with some padding.
|
// Scan header line with some padding.
|
||||||
buf := make([]byte, headerLength)
|
buf := make([]byte, headerLength)
|
||||||
n, err := f.f.Read([]byte(buf))
|
n, err := f.f.Read(buf)
|
||||||
if err != nil && err != io.EOF {
|
if err != nil && err != io.EOF {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue