owncast/.golangci.yml
2023-10-17 18:33:05 -07:00

96 lines
2.3 KiB
YAML

run:
tests: false
modules-download-mode: readonly
# Define the Go version limit.
# Mainly related to generics support in go1.18.
# Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.18
go: '1.21'
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
- unused
- 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.21'
# https://staticcheck.io/docs/options#checks
checks: ['all']
gocritic:
disabled-checks:
- ifElseChain
- exitAfterDefer
revive:
rules:
- name: package-comments
disabled: true
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