2019-10-15 16:37:46 -05:00
|
|
|
linters-settings:
|
|
|
|
errcheck:
|
2024-07-27 18:20:09 -05:00
|
|
|
exclude-functions:
|
|
|
|
- fmt.*
|
|
|
|
- (go.uber.org/zap/zapcore.ObjectEncoder).AddObject
|
|
|
|
- (go.uber.org/zap/zapcore.ObjectEncoder).AddArray
|
2023-08-14 10:41:15 -05:00
|
|
|
gci:
|
|
|
|
sections:
|
|
|
|
- standard # Standard section: captures all standard packages.
|
|
|
|
- default # Default section: contains all imports that could not be matched to another section type.
|
|
|
|
- prefix(github.com/caddyserver/caddy/v2/cmd) # ensure that this is always at the top and always has a line break.
|
|
|
|
- prefix(github.com/caddyserver/caddy) # Custom section: groups all imports with the specified Prefix.
|
|
|
|
# Skip generated files.
|
|
|
|
# Default: true
|
|
|
|
skip-generated: true
|
|
|
|
# Enable custom order of sections.
|
|
|
|
# If `true`, make the section order the same as the order of `sections`.
|
|
|
|
# Default: false
|
|
|
|
custom-order: true
|
2024-01-25 10:24:58 -05:00
|
|
|
exhaustive:
|
|
|
|
ignore-enum-types: reflect.Kind|svc.Cmd
|
2019-10-15 16:37:46 -05:00
|
|
|
|
|
|
|
linters:
|
2020-11-22 16:50:29 -05:00
|
|
|
disable-all: true
|
2019-10-15 16:37:46 -05:00
|
|
|
enable:
|
2024-01-25 10:24:58 -05:00
|
|
|
- asasalint
|
|
|
|
- asciicheck
|
|
|
|
- bidichk
|
2019-10-15 16:37:46 -05:00
|
|
|
- bodyclose
|
2024-01-25 10:24:58 -05:00
|
|
|
- decorder
|
|
|
|
- dogsled
|
|
|
|
- dupl
|
|
|
|
- dupword
|
|
|
|
- durationcheck
|
2019-10-15 16:37:46 -05:00
|
|
|
- errcheck
|
2024-01-25 10:24:58 -05:00
|
|
|
- errname
|
|
|
|
- exhaustive
|
2023-08-14 10:41:15 -05:00
|
|
|
- gci
|
2024-01-25 10:24:58 -05:00
|
|
|
- gofmt
|
|
|
|
- goimports
|
2023-08-07 14:40:31 -05:00
|
|
|
- gofumpt
|
2019-10-15 16:37:46 -05:00
|
|
|
- gosec
|
2020-11-22 16:50:29 -05:00
|
|
|
- gosimple
|
|
|
|
- govet
|
2019-10-15 16:37:46 -05:00
|
|
|
- ineffassign
|
2024-01-25 10:24:58 -05:00
|
|
|
- importas
|
2019-10-15 16:37:46 -05:00
|
|
|
- misspell
|
2020-11-22 16:50:29 -05:00
|
|
|
- prealloc
|
2024-01-25 10:24:58 -05:00
|
|
|
- promlinter
|
|
|
|
- sloglint
|
|
|
|
- sqlclosecheck
|
2020-11-22 16:50:29 -05:00
|
|
|
- staticcheck
|
2024-01-25 10:24:58 -05:00
|
|
|
- tenv
|
|
|
|
- testableexamples
|
|
|
|
- testifylint
|
|
|
|
- tparallel
|
2020-11-22 16:50:29 -05:00
|
|
|
- typecheck
|
|
|
|
- unconvert
|
|
|
|
- unused
|
2024-01-25 10:24:58 -05:00
|
|
|
- wastedassign
|
|
|
|
- whitespace
|
|
|
|
- zerologlint
|
2020-11-22 16:50:29 -05:00
|
|
|
# these are implicitly disabled:
|
2024-01-25 10:24:58 -05:00
|
|
|
# - containedctx
|
|
|
|
# - contextcheck
|
|
|
|
# - cyclop
|
2020-11-22 16:50:29 -05:00
|
|
|
# - depguard
|
2024-01-25 10:24:58 -05:00
|
|
|
# - errchkjson
|
|
|
|
# - errorlint
|
|
|
|
# - exhaustruct
|
|
|
|
# - execinquery
|
|
|
|
# - exhaustruct
|
|
|
|
# - forbidigo
|
|
|
|
# - forcetypeassert
|
2020-11-22 16:50:29 -05:00
|
|
|
# - funlen
|
2024-01-25 10:24:58 -05:00
|
|
|
# - ginkgolinter
|
|
|
|
# - gocheckcompilerdirectives
|
2020-11-22 16:50:29 -05:00
|
|
|
# - gochecknoglobals
|
|
|
|
# - gochecknoinits
|
2024-01-25 10:24:58 -05:00
|
|
|
# - gochecksumtype
|
2020-11-22 16:50:29 -05:00
|
|
|
# - gocognit
|
|
|
|
# - goconst
|
|
|
|
# - gocritic
|
|
|
|
# - gocyclo
|
|
|
|
# - godot
|
|
|
|
# - godox
|
|
|
|
# - goerr113
|
|
|
|
# - goheader
|
|
|
|
# - gomnd
|
2024-01-25 10:24:58 -05:00
|
|
|
# - gomoddirectives
|
2020-11-22 16:50:29 -05:00
|
|
|
# - gomodguard
|
|
|
|
# - goprintffuncname
|
2024-01-25 10:24:58 -05:00
|
|
|
# - gosmopolitan
|
|
|
|
# - grouper
|
|
|
|
# - inamedparam
|
|
|
|
# - interfacebloat
|
|
|
|
# - ireturn
|
2020-11-22 16:50:29 -05:00
|
|
|
# - lll
|
2024-01-25 10:24:58 -05:00
|
|
|
# - loggercheck
|
|
|
|
# - maintidx
|
|
|
|
# - makezero
|
|
|
|
# - mirror
|
|
|
|
# - musttag
|
2020-11-22 16:50:29 -05:00
|
|
|
# - nakedret
|
|
|
|
# - nestif
|
2024-01-25 10:24:58 -05:00
|
|
|
# - nilerr
|
|
|
|
# - nilnil
|
2020-11-22 16:50:29 -05:00
|
|
|
# - nlreturn
|
|
|
|
# - noctx
|
|
|
|
# - nolintlint
|
2024-01-25 10:24:58 -05:00
|
|
|
# - nonamedreturns
|
|
|
|
# - nosprintfhostport
|
|
|
|
# - paralleltest
|
|
|
|
# - perfsprint
|
|
|
|
# - predeclared
|
|
|
|
# - protogetter
|
|
|
|
# - reassign
|
|
|
|
# - revive
|
2020-11-22 16:50:29 -05:00
|
|
|
# - rowserrcheck
|
|
|
|
# - stylecheck
|
2024-01-25 10:24:58 -05:00
|
|
|
# - tagalign
|
|
|
|
# - tagliatelle
|
2020-11-22 16:50:29 -05:00
|
|
|
# - testpackage
|
2024-01-25 10:24:58 -05:00
|
|
|
# - thelper
|
2020-11-22 16:50:29 -05:00
|
|
|
# - unparam
|
2024-01-25 10:24:58 -05:00
|
|
|
# - usestdlibvars
|
|
|
|
# - varnamelen
|
|
|
|
# - wrapcheck
|
2020-11-22 16:50:29 -05:00
|
|
|
# - wsl
|
2019-10-15 16:37:46 -05:00
|
|
|
|
|
|
|
run:
|
|
|
|
# default concurrency is a available CPU number.
|
|
|
|
# concurrency: 4 # explicitly omit this value to fully utilize available resources.
|
2024-07-27 18:20:09 -05:00
|
|
|
timeout: 5m
|
2019-10-15 16:37:46 -05:00
|
|
|
issues-exit-code: 1
|
|
|
|
tests: false
|
|
|
|
|
|
|
|
# output configuration options
|
|
|
|
output:
|
2024-07-27 18:20:09 -05:00
|
|
|
formats:
|
|
|
|
- format: 'colored-line-number'
|
2019-10-15 16:37:46 -05:00
|
|
|
print-issued-lines: true
|
|
|
|
print-linter-name: true
|
|
|
|
|
|
|
|
issues:
|
|
|
|
exclude-rules:
|
2024-09-16 08:50:26 -05:00
|
|
|
- text: 'G115' # TODO: Either we should fix the issues or nuke the linter if it's bad
|
|
|
|
linters:
|
|
|
|
- gosec
|
2019-10-15 16:37:46 -05:00
|
|
|
# we aren't calling unknown URL
|
2023-08-14 10:41:15 -05:00
|
|
|
- text: 'G107' # G107: Url provided to HTTP request as taint input
|
2019-10-15 16:37:46 -05:00
|
|
|
linters:
|
|
|
|
- gosec
|
|
|
|
# as a web server that's expected to handle any template, this is totally in the hands of the user.
|
2023-08-14 10:41:15 -05:00
|
|
|
- text: 'G203' # G203: Use of unescaped data in HTML templates
|
2019-10-15 16:37:46 -05:00
|
|
|
linters:
|
|
|
|
- gosec
|
|
|
|
# we're shelling out to known commands, not relying on user-defined input.
|
2023-08-14 10:41:15 -05:00
|
|
|
- text: 'G204' # G204: Audit use of command execution
|
2019-10-15 16:37:46 -05:00
|
|
|
linters:
|
|
|
|
- gosec
|
|
|
|
# the choice of weakrand is deliberate, hence the named import "weakrand"
|
|
|
|
- path: modules/caddyhttp/reverseproxy/selectionpolicies.go
|
2023-08-14 10:41:15 -05:00
|
|
|
text: 'G404' # G404: Insecure random number source (rand)
|
2019-10-15 16:37:46 -05:00
|
|
|
linters:
|
|
|
|
- gosec
|
2022-11-14 11:38:02 -05:00
|
|
|
- path: modules/caddyhttp/reverseproxy/streaming.go
|
2023-08-14 10:41:15 -05:00
|
|
|
text: 'G404' # G404: Insecure random number source (rand)
|
2022-11-14 11:38:02 -05:00
|
|
|
linters:
|
|
|
|
- gosec
|
2024-01-25 10:24:58 -05:00
|
|
|
- path: modules/logging/filters.go
|
|
|
|
linters:
|
|
|
|
- dupl
|
2024-10-02 07:34:04 -05:00
|
|
|
- path: modules/caddyhttp/matchers.go
|
|
|
|
linters:
|
|
|
|
- dupl
|
|
|
|
- path: modules/caddyhttp/vars.go
|
|
|
|
linters:
|
|
|
|
- dupl
|
2024-07-27 18:20:09 -05:00
|
|
|
- path: _test\.go
|
|
|
|
linters:
|
|
|
|
- errcheck
|