From b5cd5579747a459113a7e6c899fca5c6afbea066 Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Thu, 30 Jul 2026 20:07:04 +0200 Subject: init --- .golangci.yaml | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 .golangci.yaml (limited to '.golangci.yaml') diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000..9d3fb3d --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,92 @@ +# SPDX-FileCopyrightText: 2025 Stefan Majewsky +# SPDX-License-Identifier: Apache-2.0 + +version: "2" +run: + timeout: 3m0s # none by default in v2 + +formatters: + enable: + - gofmt + - goimports + +issues: + max-issues-per-linter: 0 # no limit + max-same-issues: 0 # no limit + +linters: + default: standard + enable: + - errorlint + - exhaustive + - gocheckcompilerdirectives + - goconst + - gocritic + - gosec + - intrange + - misspell + - musttag + - nilerr + - nolintlint + - perfsprint + - prealloc + - predeclared + - reassign + - unconvert + - usestdlibvars + - usetesting + - wastedassign + - whitespace + settings: + goconst: + min-occurrences: 6 + gocritic: + disable-all: true + enabled-checks: + - boolExprSimplify + - builtinShadow + - emptyStringTest + - evalOrder + - httpNoBody + - importShadow + - initClause + - methodExprCall + - paramTypeCombine + - preferFilepathJoin + - ptrToRefParam + - redundantSprint + - returnAfterHttpError + - stringConcatSimplify + - timeExprSimplify + - truncateCmp + - typeAssertChain + - typeUnparen + - unnamedResult + - unnecessaryBlock + - unnecessaryDefer + - weakCond + - yodaStyleExpr + gomoddirectives: + toolchain-forbidden: true + go-version-pattern: 1\.\d+(\.0)?$ + gosec: + excludes: + - G204 # gosec likes to scream about the fact that we are passing paths derived from $PWD into command invocations + - G306 # gosec does not understand how umask works + nolintlint: + require-specific: true + staticcheck: + dot-import-whitelist: + - go.xyrillian.de/gg/option + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - path: (.+)\.go$ + text: declaration of "err" shadows declaration at + - path: _test\.go + linters: [ goconst ] -- cgit v1.3.1