chore: migrate to golangci-lint v2
All checks were successful
submodules sync / sync (push) Successful in 1m10s
build / build (push) Successful in 3m25s
build / trigger-build-image (push) Successful in 9s

This commit is contained in:
张泊明518370910136 2025-07-20 00:54:05 -07:00
parent 1c559ed2e5
commit 0b15a50f48
No known key found for this signature in database
GPG Key ID: 134DACA8458EB0E3
2 changed files with 29 additions and 17 deletions

View File

@ -1,28 +1,43 @@
version: "2"
linters:
enable:
- bidichk
- dupl
- errcheck
- gocritic
- gofmt
- gofumpt
- goimports
- gosec
- gosimple
- govet
- ineffassign
- nakedret
- nolintlint
- prealloc
- staticcheck
- stylecheck
- testifylint
- typecheck
- unconvert
- unused
- unparam
- usetesting
- wastedassign
linters-settings:
stylecheck:
checks: ["all", "-ST1005"]
settings:
staticcheck:
checks:
- all
- -ST1005
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$

View File

@ -99,10 +99,7 @@ func (d *Diff) processOutput(output Output, result stage.ExecutorResult, conf *C
}
// They are different.
forceQuit := false
if output.ForceQuitOnDiff || conf.ForceQuitOnFailed {
forceQuit = true
}
forceQuit := output.ForceQuitOnDiff
comment := conf.FailComment + "\n"
comment += fmt.Sprintf("Difference found in `%s`\n", output.Filename)