mirror of https://github.com/databricks/cli.git
Compare commits
8 Commits
68a894ba92
...
4639a73343
Author | SHA1 | Date |
---|---|---|
|
4639a73343 | |
|
82ac762aa8 | |
|
db551ac192 | |
|
d4d0a36087 | |
|
0027c654f1 | |
|
e852499473 | |
|
5479cf2eda | |
|
a3c6b5ed76 |
|
@ -96,7 +96,7 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: stable
|
||||
go-version: 1.23.2
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v6
|
||||
with:
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
linters:
|
||||
# Disable all linters.
|
||||
# Default: false
|
||||
disable-all: true
|
||||
# Enable specific linter
|
||||
# https://golangci-lint.run/usage/linters/#enabled-by-default
|
||||
enable:
|
||||
# errcheck and govet are part of default setup and should be included but give too many errors now
|
||||
# once errors are fixed, they should be enabled here:
|
||||
|
@ -17,12 +13,7 @@ linters:
|
|||
linters-settings:
|
||||
gofmt:
|
||||
rewrite-rules:
|
||||
#- pattern: 'interface{}'
|
||||
# replacement: 'any'
|
||||
- pattern: 'a[b:len(a)]'
|
||||
replacement: 'a[b:]'
|
||||
issues:
|
||||
exclude-dirs-use-default: false # recommended by docs https://golangci-lint.run/usage/false-positives/
|
||||
exclude:
|
||||
- "SA1019: tfexec.State is deprecated: The -state CLI flag is a legacy flag and should not be used. If you need a different state file for every run, you can instead use the local backend. See https://github.com/hashicorp/terraform/issues/25920#issuecomment-676560799"
|
||||
- "SA1012: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use"
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
"editor.insertSpaces": false,
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"go.lintTool": "golangci-lint",
|
||||
"go.lintFlags": [
|
||||
"--fast"
|
||||
],
|
||||
"files.trimTrailingWhitespace": true,
|
||||
"files.insertFinalNewline": true,
|
||||
"files.trimFinalNewlines": true,
|
||||
|
|
4
Makefile
4
Makefile
|
@ -10,6 +10,10 @@ lint: vendor
|
|||
@echo "✓ Linting source code with https://golangci-lint.run/ ..."
|
||||
@golangci-lint run ./...
|
||||
|
||||
lintfix: vendor
|
||||
@echo "✓ Linting source code with 'golangci-lint run --fix' ..."
|
||||
@golangci-lint run --fix ./...
|
||||
|
||||
test: lint testonly
|
||||
|
||||
testonly:
|
||||
|
|
|
@ -56,7 +56,7 @@ func (m *importResource) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagn
|
|||
buf := bytes.NewBuffer(nil)
|
||||
tf.SetStdout(buf)
|
||||
|
||||
//lint:ignore SA1019 We use legacy -state flag for now to plan the import changes based on temporary state file
|
||||
//nolint:staticcheck // SA1019 We use legacy -state flag for now to plan the import changes based on temporary state file
|
||||
changed, err := tf.Plan(ctx, tfexec.State(tmpState), tfexec.Target(importAddress))
|
||||
if err != nil {
|
||||
return diag.Errorf("terraform plan: %v", err)
|
||||
|
|
|
@ -250,7 +250,7 @@ func (t *cobraTestRunner) RunBackground() {
|
|||
// Reset context on command for the next test.
|
||||
// These commands are globals so we have to clean up to the best of our ability after each run.
|
||||
// See https://github.com/spf13/cobra/blob/a6f198b635c4b18fff81930c40d464904e55b161/command.go#L1062-L1066
|
||||
//lint:ignore SA1012 cobra sets the context and doesn't clear it
|
||||
//nolint:staticcheck // cobra sets the context and doesn't clear it
|
||||
cli.SetContext(nil)
|
||||
|
||||
// Make caller aware of error.
|
||||
|
|
Loading…
Reference in New Issue