owncast/.golangci.yml
2022-01-12 16:29:22 -08:00

87 lines
2.1 KiB
YAML

run:
tests: false
modules-download-mode: readonly
issues:
# The linter has a default list of ignorable errors. Turning this on will enable that list.
exclude-use-default: false
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-issues-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0
exclude:
- Subprocess launch(ed with variable|ing should be audited)
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
- G307 # Allow closing files as a defer without checking error.
- composite literal uses unkeyed fields
linters:
enable:
- bodyclose
- dupl
- errcheck
- exportloopref
- goconst
- godot
- godox
- goimports
- goprintffuncname
- gosec
- govet
- misspell
- prealloc
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- unconvert
- unparam
- whitespace
- nakedret
- cyclop
- gosimple
- varcheck
- unused
- deadcode
- exportloopref
- gocritic
- forbidigo
- unparam
- wastedassign
linters-settings:
govet:
disable:
- composite
cyclop:
# the maximal code complexity to report. default is 10. eventually work our way to that.
max-complexity: 15
# the max average package complexity. If it's higher than 0.0 (float) the check is enabled (default 0.0)
package-average: 0.0
# should ignore tests
skip-tests: true
gosimple:
# Select the Go version to target. The default is '1.13'.
go: "1.17"
# https://staticcheck.io/docs/options#checks
checks: ["all"]
gocritic:
disabled-checks:
- ifElseChain
- exitAfterDefer
forbidigo:
# Forbid the following identifiers (identifiers are written using regexp):
forbid:
# Logging via Print bypasses our logging framework.
- ^(fmt\.Print(|f|ln)|print|println)
- ^panic.*$
dupl:
# tokens count to trigger issue, 150 by default
threshold: 200