From 0b15a50f48e6bf17b3df8f688dbb5b44fbf2d8ce Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Sun, 20 Jul 2025 00:54:05 -0700 Subject: [PATCH] chore: migrate to golangci-lint v2 --- .golangci.yaml | 41 +++++++++++++++++++++++----------- internal/parser/diff/parser.go | 5 +---- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index d55bac5..adc889d 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -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$ diff --git a/internal/parser/diff/parser.go b/internal/parser/diff/parser.go index 7133483..7aeaf8e 100644 --- a/internal/parser/diff/parser.go +++ b/internal/parser/diff/parser.go @@ -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)