2022-05-18 22:24:40 +08:00
|
|
|
## This file contains all available configuration options
|
|
|
|
## with their default values.
|
2022-05-23 22:09:11 +08:00
|
|
|
|
2022-05-18 22:24:40 +08:00
|
|
|
# See https://github.com/golangci/golangci-lint#config-file
|
2021-11-16 17:21:13 +08:00
|
|
|
run:
|
2022-05-18 22:24:40 +08:00
|
|
|
issues-exit-code: 1 #Default
|
|
|
|
tests: true #Default
|
2021-11-16 17:21:13 +08:00
|
|
|
|
|
|
|
linters:
|
2022-05-18 22:24:40 +08:00
|
|
|
# Disable everything by default so upgrades to not include new "default
|
|
|
|
# enabled" linters.
|
|
|
|
disable-all: true
|
|
|
|
# Specifically enable linters we want to use.
|
|
|
|
enable:
|
|
|
|
- deadcode
|
|
|
|
- errcheck
|
|
|
|
- gofmt
|
|
|
|
- goimports
|
|
|
|
- gosimple
|
|
|
|
- govet
|
|
|
|
- godot
|
|
|
|
- ineffassign
|
|
|
|
- misspell
|
|
|
|
- revive
|
|
|
|
- staticcheck
|
|
|
|
- structcheck
|
2021-11-16 17:21:13 +08:00
|
|
|
- typecheck
|
2022-05-18 22:24:40 +08:00
|
|
|
- unused
|
|
|
|
- varcheck
|
2021-11-16 17:21:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
issues:
|
|
|
|
exclude-rules:
|
2022-05-18 22:24:40 +08:00
|
|
|
# helpers in tests often (rightfully) pass a *testing.T as their first argument
|
|
|
|
- path: _test\.go
|
|
|
|
text: "context.Context should be the first parameter of a function"
|
2021-11-16 17:21:13 +08:00
|
|
|
linters:
|
2022-05-18 22:24:40 +08:00
|
|
|
- revive
|
|
|
|
# Yes, they are, but it's okay in a test
|
|
|
|
- path: _test\.go
|
|
|
|
text: "exported func.*returns unexported type.*which can be annoying to use"
|
2021-11-16 17:21:13 +08:00
|
|
|
linters:
|
2022-05-18 22:24:40 +08:00
|
|
|
- revive
|
2021-11-16 17:21:13 +08:00
|
|
|
|
2022-05-18 22:24:40 +08:00
|
|
|
linters-settings:
|
|
|
|
misspell:
|
|
|
|
locale: US
|
|
|
|
ignore-words:
|
|
|
|
- cancelled
|
|
|
|
goimports:
|
|
|
|
local-prefixes: github.com/gogf/gf
|
|
|
|
godot:
|
|
|
|
# Comments to be checked: `declarations`, `toplevel`, or `all`.
|
|
|
|
# Default: declarations
|
|
|
|
scope: toplevel
|
|
|
|
exclude:
|
|
|
|
# Exclude sentence fragments for lists.
|
|
|
|
- '^[ ]*[-•]'
|
|
|
|
# Exclude sentences prefixing a list.
|
|
|
|
- ':$'
|
|
|
|
# Check that each sentence ends with a period.
|
|
|
|
# Default: true
|
|
|
|
period: false
|
|
|
|
# Check that each sentence starts with a capital letter.
|
|
|
|
# Default: false
|
|
|
|
capital: false
|