Files
pipelinedb/.golangci.yml
2025-09-30 15:05:56 +08:00

154 lines
2.5 KiB
YAML

run:
timeout: 5m
issues-exit-code: 1
tests: true
skip-dirs:
- vendor
skip-files:
- ".*\\.pb\\.go$"
output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true
linters-settings:
errcheck:
check-type-assertions: true
check-blank: true
gocyclo:
min-complexity: 15
gofmt:
simplify: true
goimports:
local-prefixes: code.tczkiot.com/wlw/pipelinedb
golint:
min-confidence: 0.8
govet:
check-shadowing: true
enable-all: true
misspell:
locale: US
unused:
check-exported: false
unparam:
check-exported: false
nakedret:
max-func-lines: 30
prealloc:
simple: true
range-loops: true
for-loops: false
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
linters:
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- errcheck
- exhaustive
- exportloopref
- funlen
- gochecknoinits
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- golint
- gomnd
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- lll
- misspell
- nakedret
- noctx
- nolintlint
- rowserrcheck
- scopelint
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace
disable:
- maligned # 已废弃
- dupl # 允许一定程度的代码重复
issues:
exclude-rules:
# 排除测试文件的某些检查
- path: _test\.go
linters:
- gomnd
- funlen
- gocyclo
# 排除示例文件的某些检查
- path: examples/
linters:
- gomnd
- funlen
- errcheck
# 排除基准测试的某些检查
- path: benchmark_test\.go
linters:
- gomnd
- funlen
- gocyclo
# 排除 main 函数的长度检查
- text: "Function 'main' has too many statements"
linters:
- funlen
# 排除已知的误报
- text: "G404: Use of weak random number generator"
linters:
- gosec
path: _test\.go
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0
new: false
severity:
default-severity: error
case-sensitive: false