diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cdb0f667..fc60117b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,4 +30,4 @@ jobs: with: go-version-file: 'go.mod' - name: golangci-lint - uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1 + uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 diff --git a/.golangci.yml b/.golangci.yml index 48e0f0e2..5c75c9c9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,21 +1,8 @@ ---- +version: "2" run: concurrency: 6 - timeout: 5m -issues: - # Maximum issues count per one linter. - # Set to 0 to disable. - # Default: 50 - max-issues-per-linter: 0 - # Maximum count of issues with the same text. - # Set to 0 to disable. - # Default: 3 - max-same-issues: 0 - # Exclude previously existing issues from the report - new: true - new-from-rev: HEAD linters: - disable-all: true + default: none enable: - asciicheck - bodyclose @@ -25,104 +12,113 @@ linters: - errcheck - errorlint - exhaustive - - gci - #- gochecknoinits - gocognit - goconst - gocritic - gocyclo - godot - godox - #- goerr113 - - gofmt - - gofumpt - goheader - - goimports - gomodguard - goprintffuncname - gosec - - gosimple - #- govet - ineffassign - #- lll - makezero - misspell - nakedret - nestif - noctx - nolintlint - #- paralleltest - predeclared - staticcheck - - stylecheck - thelper - tparallel - - typecheck - unconvert - unparam - unused - whitespace - wrapcheck -linters-settings: - errcheck: - check-type-assertions: true - check-blank: true - exhaustive: - # https://golangci-lint.run/usage/linters/#exhaustive - default-signifies-exhaustive: true - govet: - enable: - - fieldalignment - godox: - keywords: - - BUG - - FIXME - - HACK - gci: - sections: - - standard - - default - - prefix(github.com/ossf/package-analysis) - gocritic: - enabled-checks: - # Diagnostic - - appendAssign - - badCond - - caseOrder - - codegenComment - - commentedOutCode - - deprecatedComment - - dupBranchBody - - dupCase - - dupSubExpr - - exitAfterDefer - - flagName - - nilValReturn - - weakCond - - octalLiteral - - # Performance - - appendCombine - #- hugeParam - - rangeExprCopy - - rangeValCopy - - # Style - - boolExprSimplify - - captLocal - - commentFormatting - - commentedOutImport - - defaultCaseOrder - - docStub - - elseif - - emptyFallthrough - - hexLiteral - - ifElseChain - - methodExprCall - - singleCaseSwitch - - typeAssertChain - - typeSwitchVar - - underef - - unlabelStmt - - unlambda - + settings: + errcheck: + check-type-assertions: true + check-blank: true + exhaustive: + default-signifies-exhaustive: true + gocritic: + enabled-checks: + - appendAssign + - badCond + - caseOrder + - codegenComment + - commentedOutCode + - deprecatedComment + - dupBranchBody + - dupCase + - dupSubExpr + - exitAfterDefer + - flagName + - nilValReturn + - weakCond + - octalLiteral + - appendCombine + - rangeExprCopy + - rangeValCopy + - boolExprSimplify + - captLocal + - commentFormatting + - commentedOutImport + - defaultCaseOrder + - docStub + - elseif + - emptyFallthrough + - hexLiteral + - ifElseChain + - methodExprCall + - singleCaseSwitch + - typeAssertChain + - typeSwitchVar + - underef + - unlabelStmt + - unlambda + godox: + keywords: + - BUG + - FIXME + - HACK + govet: + enable: + - fieldalignment + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +issues: + max-issues-per-linter: 0 + max-same-issues: 0 + new-from-rev: HEAD + new: true +formatters: + enable: + - gci + - gofmt + - gofumpt + - goimports + settings: + gci: + sections: + - standard + - default + - prefix(github.com/ossf/package-analysis) + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$