2020-11-13 01:42:39 +03:00
|
|
|
run:
|
|
|
|
tests: false
|
2021-09-12 10:18:15 +03:00
|
|
|
modules-download-mode: readonly
|
2020-11-13 01:42:39 +03:00
|
|
|
|
2022-04-12 22:14:42 +03:00
|
|
|
# Define the Go version limit.
|
|
|
|
# Mainly related to generics support in go1.18.
|
2022-12-07 01:31:08 +03:00
|
|
|
# Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.18
|
2023-10-18 04:32:50 +03:00
|
|
|
go: '1.21'
|
2022-04-12 22:14:42 +03:00
|
|
|
|
2020-11-13 01:42:39 +03:00
|
|
|
issues:
|
2021-09-12 10:18:15 +03:00
|
|
|
# The linter has a default list of ignorable errors. Turning this on will enable that list.
|
|
|
|
exclude-use-default: false
|
2021-11-27 07:55:58 +03:00
|
|
|
|
2021-09-12 10:18:15 +03:00
|
|
|
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
|
2020-11-13 01:42:39 +03:00
|
|
|
max-issues-per-linter: 0
|
2021-11-27 07:55:58 +03:00
|
|
|
|
2021-09-12 10:18:15 +03:00
|
|
|
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
|
2020-11-13 01:42:39 +03:00
|
|
|
max-same-issues: 0
|
|
|
|
|
2021-09-12 10:18:15 +03:00
|
|
|
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
|
|
|
|
|
2020-11-13 01:42:39 +03:00
|
|
|
linters:
|
|
|
|
enable:
|
|
|
|
- bodyclose
|
|
|
|
- dupl
|
2021-09-12 10:18:15 +03:00
|
|
|
- errcheck
|
2020-11-13 01:42:39 +03:00
|
|
|
- exportloopref
|
|
|
|
- goconst
|
|
|
|
- godot
|
|
|
|
- godox
|
|
|
|
- goimports
|
|
|
|
- goprintffuncname
|
|
|
|
- gosec
|
2021-09-12 10:18:15 +03:00
|
|
|
- govet
|
2020-11-13 01:42:39 +03:00
|
|
|
- misspell
|
|
|
|
- prealloc
|
2021-09-12 10:18:15 +03:00
|
|
|
- revive
|
2020-11-13 01:42:39 +03:00
|
|
|
- rowserrcheck
|
|
|
|
- sqlclosecheck
|
2021-09-12 10:18:15 +03:00
|
|
|
- staticcheck
|
2020-11-13 01:42:39 +03:00
|
|
|
- unconvert
|
|
|
|
- unparam
|
|
|
|
- whitespace
|
2021-10-25 10:31:45 +03:00
|
|
|
- nakedret
|
|
|
|
- cyclop
|
|
|
|
- gosimple
|
|
|
|
- unused
|
|
|
|
- exportloopref
|
|
|
|
- gocritic
|
|
|
|
- forbidigo
|
|
|
|
- unparam
|
|
|
|
- wastedassign
|
2021-07-20 09:37:06 +03:00
|
|
|
linters-settings:
|
|
|
|
govet:
|
|
|
|
disable:
|
2021-09-12 10:18:15 +03:00
|
|
|
- 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.
|
2021-11-27 07:55:58 +03:00
|
|
|
max-complexity: 15
|
2021-10-25 10:31:45 +03:00
|
|
|
# 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
|
2021-11-27 07:55:58 +03:00
|
|
|
skip-tests: true
|
2021-10-25 10:31:45 +03:00
|
|
|
|
|
|
|
gosimple:
|
|
|
|
# Select the Go version to target. The default is '1.13'.
|
2023-10-18 04:32:50 +03:00
|
|
|
go: '1.21'
|
2021-10-25 10:31:45 +03:00
|
|
|
# https://staticcheck.io/docs/options#checks
|
2022-08-27 05:20:45 +03:00
|
|
|
checks: ['all']
|
2021-10-25 10:31:45 +03:00
|
|
|
|
|
|
|
gocritic:
|
|
|
|
disabled-checks:
|
|
|
|
- ifElseChain
|
|
|
|
- exitAfterDefer
|
|
|
|
|
2022-08-27 05:26:51 +03:00
|
|
|
revive:
|
|
|
|
rules:
|
|
|
|
- name: package-comments
|
|
|
|
disabled: true
|
|
|
|
|
2021-10-25 10:31:45 +03:00
|
|
|
forbidigo:
|
|
|
|
# Forbid the following identifiers (identifiers are written using regexp):
|
|
|
|
forbid:
|
2022-08-27 05:20:45 +03:00
|
|
|
# Logging via Print bypasses our logging framework.
|
2021-10-25 10:31:45 +03:00
|
|
|
- ^(fmt\.Print(|f|ln)|print|println)
|
|
|
|
- ^panic.*$
|
2022-01-13 00:53:10 +03:00
|
|
|
|
|
|
|
dupl:
|
|
|
|
# tokens count to trigger issue, 150 by default
|
2022-01-13 03:29:22 +03:00
|
|
|
threshold: 200
|