diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 16f30be..d4c870c 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -3,7 +3,7 @@ name: golangci-lint on: push: branches: - - main + - '**' pull_request: permissions: @@ -27,6 +27,6 @@ jobs: go-version: ${{ env.GO_VERSION }} - name: Run golangci-lint - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@v7 with: - version: v1.62.2 + version: v2.1.5 diff --git a/.golangci.yml b/.golangci.yml index dfc12f3..72044f7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,22 +1,18 @@ +version: "2" run: - timeout: 1m - + timeout: 2m linters: - disable-all: true + default: none enable: - dupl - errcheck - errname - errorlint - funlen - - gci - goconst - gocritic - gocyclo - - gofmt - - goimports - gosec - - gosimple - govet - ineffassign - lll @@ -25,18 +21,36 @@ linters: - prealloc - revive - staticcheck - - stylecheck - thelper - tparallel - - typecheck - unconvert - unparam - unused - whitespace - -issues: - exclude-rules: - - path: _test\.go - linters: - - unparam - - funlen + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - linters: + - funlen + - unparam + path: _test\.go + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gci + - gofmt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/internal/terminal/spinner.go b/internal/terminal/spinner.go index e2b40c4..64c5b66 100644 --- a/internal/terminal/spinner.go +++ b/internal/terminal/spinner.go @@ -62,7 +62,7 @@ func (s *Spinner) Start() { }() } -//nolint:errcheck +//nolint:errcheck,staticcheck func (s *Spinner) Clear() { s.writer.WriteString(fmt.Sprintf(moveCursorBackward, s.length)) s.writer.WriteString(clearLineFromCursor)