Compare commits

..

No commits in common. "4639a73343851fc15fe442f280c73059d7673dd5" and "68a894ba92b787ee9ee39c5aabf01531e8559927" have entirely different histories.

6 changed files with 12 additions and 11 deletions

View File

@ -96,7 +96,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: 1.23.2 go-version: stable
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v6
with: with:

View File

@ -1,5 +1,9 @@
linters: linters:
# Disable all linters.
# Default: false
disable-all: true disable-all: true
# Enable specific linter
# https://golangci-lint.run/usage/linters/#enabled-by-default
enable: enable:
# errcheck and govet are part of default setup and should be included but give too many errors now # 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: # once errors are fixed, they should be enabled here:
@ -13,7 +17,12 @@ linters:
linters-settings: linters-settings:
gofmt: gofmt:
rewrite-rules: rewrite-rules:
#- pattern: 'interface{}'
# replacement: 'any'
- pattern: 'a[b:len(a)]' - pattern: 'a[b:len(a)]'
replacement: 'a[b:]' replacement: 'a[b:]'
issues: issues:
exclude-dirs-use-default: false # recommended by docs https://golangci-lint.run/usage/false-positives/ 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"

View File

@ -3,10 +3,6 @@
"editor.insertSpaces": false, "editor.insertSpaces": false,
"editor.formatOnSave": true "editor.formatOnSave": true
}, },
"go.lintTool": "golangci-lint",
"go.lintFlags": [
"--fast"
],
"files.trimTrailingWhitespace": true, "files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true, "files.insertFinalNewline": true,
"files.trimFinalNewlines": true, "files.trimFinalNewlines": true,

View File

@ -10,10 +10,6 @@ lint: vendor
@echo "✓ Linting source code with https://golangci-lint.run/ ..." @echo "✓ Linting source code with https://golangci-lint.run/ ..."
@golangci-lint run ./... @golangci-lint run ./...
lintfix: vendor
@echo "✓ Linting source code with 'golangci-lint run --fix' ..."
@golangci-lint run --fix ./...
test: lint testonly test: lint testonly
testonly: testonly:

View File

@ -56,7 +56,7 @@ func (m *importResource) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagn
buf := bytes.NewBuffer(nil) buf := bytes.NewBuffer(nil)
tf.SetStdout(buf) tf.SetStdout(buf)
//nolint:staticcheck // SA1019 We use legacy -state flag for now to plan the import changes based on temporary state file //lint:ignore 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)) changed, err := tf.Plan(ctx, tfexec.State(tmpState), tfexec.Target(importAddress))
if err != nil { if err != nil {
return diag.Errorf("terraform plan: %v", err) return diag.Errorf("terraform plan: %v", err)

View File

@ -250,7 +250,7 @@ func (t *cobraTestRunner) RunBackground() {
// Reset context on command for the next test. // 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. // 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 // See https://github.com/spf13/cobra/blob/a6f198b635c4b18fff81930c40d464904e55b161/command.go#L1062-L1066
//nolint:staticcheck // cobra sets the context and doesn't clear it //lint:ignore SA1012 cobra sets the context and doesn't clear it
cli.SetContext(nil) cli.SetContext(nil)
// Make caller aware of error. // Make caller aware of error.