owncast/.golangci.yml

84 lines
2 KiB
YAML
Raw Normal View History

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
2021-10-25 10:31:45 +03:00
- nakedret
- cyclop
- gosimple
- varcheck
- unused
- deadcode
- exportloopref
- gocritic
- forbidigo
- unparam
- wastedassign
2021-07-20 09:37:06 +03:00
linters-settings:
govet:
disable:
- composite
2021-10-25 10:31:45 +03:00
cyclop:
# the maximal code complexity to report. default is 10. eventually work our way to that.
max-complexity: 20
# 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.*$