1
0
Fork 0
mirror of https://github.com/spf13/viper synced 2025-10-24 01:12:29 +00:00
spf13--viper/.golangci.yaml

150 lines
2.9 KiB
YAML
Raw Permalink Normal View History

version: "2"
run:
timeout: 5m
2019-12-06 11:41:59 +01:00
linters:
enable:
- bodyclose
- dogsled
- dupl
- durationcheck
- exhaustive
- gocritic
- godot
- gomoddirectives
- goprintffuncname
- govet
- importas
- ineffassign
- makezero
- misspell
- nakedret
- nilerr
- noctx
- nolintlint
- prealloc
- predeclared
2025-08-16 06:47:16 +02:00
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- tparallel
- unconvert
- unparam
- unused
- wastedassign
- whitespace
# fixme
# - cyclop
# - errcheck
# - errorlint
# - exhaustivestruct
# - forbidigo
# - forcetypeassert
# - gochecknoglobals
# - gochecknoinits
# - gocognit
# - goconst
# - gocyclo
# - gosec
# - gosimple
# - ifshort
# - lll
# - nlreturn
# - paralleltest
# - scopelint
# - thelper
# - wrapcheck
2019-12-06 11:41:59 +01:00
# unused
# - depguard
# - goheader
# - gomodguard
2020-01-16 19:37:50 +01:00
# don't enable:
# - asciicheck
# - funlen
# - godox
# - goerr113
# - gomnd
# - interfacer
# - maligned
# - nestif
# - testpackage
# - wsl
2025-08-16 06:47:16 +02:00
exclusions:
rules:
- linters:
- errcheck
- noctx
path: _test.go
presets:
- std-error-handling
settings:
revive:
rules:
- name: blank-imports
- name: context-as-argument
arguments:
- allowTypesBefore: "*testing.T"
- name: context-keys-type
- name: dot-imports
- name: empty-block
- name: error-naming
- name: error-return
- name: error-strings
- name: errorf
- name: exported
arguments:
- "sayRepetitiveInsteadOfStutters" # make error messages clearer
- name: increment-decrement
- name: indent-error-flow
- name: package-comments
disabled: true # disable package comments rule for now
- name: range
- name: redefines-builtin-id
- name: superfluous-else
- name: time-naming
- name: unexported-return
- name: unreachable-code
- name: unused-parameter
- name: var-declaration
- name: var-naming
# TODO: add more revive rules
misspell:
locale: US
nolintlint:
allow-unused: false # report any unused nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
gocritic:
# Enable multiple checks by tags. See "Tags" section in https://github.com/go-critic/go-critic#usage.
enabled-tags:
- diagnostic
- experimental
- opinionated
- style
disabled-checks:
- importShadow
- unnamedResult
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
# - golines
settings:
gci:
sections:
- standard
- default
- localmodule