diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5eb00f3..a6ecdb3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,4 +32,4 @@ jobs: go-version-file: .go-version cache: true - name: Golangci-lint - uses: golangci/golangci-lint-action@v6.5.1 + uses: golangci/golangci-lint-action@v8.0.0 diff --git a/.go-version b/.go-version index 71f7f51..3900bcd 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.22 +1.24 diff --git a/.golangci.yml b/.golangci.yml index 52e7b9a..a403215 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,11 +1,29 @@ +version: "2" linters: enable: - - goimports - misspell - revive - -issues: - exclude-rules: - - path: _test.go - linters: - - errcheck + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - linters: + - errcheck + path: _test.go + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/walk.go b/walk.go index 6732b36..b8366b2 100644 --- a/walk.go +++ b/walk.go @@ -356,13 +356,14 @@ func (s *PromQLSmith) walkFunctions(expr *parser.Call, depth int) { } expr.Args = make([]parser.Expr, len(expr.Func.ArgTypes)) - if expr.Func.Name == "holt_winters" { + switch expr.Func.Name { + case "holt_winters": s.walkHoltWinters(expr, depth) return - } else if expr.Func.Name == "label_replace" { + case "label_replace": s.walkLabelReplace(expr, depth) return - } else if expr.Func.Name == "info" { + case "info": s.walkInfo(expr, depth) return }