2019-01-12 00:29:49 +08:00
|
|
|
# golangci-lint configuration options
|
|
|
|
|
|
|
|
linters:
|
|
|
|
enable:
|
|
|
|
- errcheck
|
|
|
|
- goimports
|
2022-08-03 20:14:51 +08:00
|
|
|
- revive
|
2019-01-12 00:29:49 +08:00
|
|
|
- ineffassign
|
|
|
|
- govet
|
|
|
|
- unconvert
|
2022-08-20 19:35:58 +08:00
|
|
|
- staticcheck
|
|
|
|
- gosimple
|
|
|
|
- stylecheck
|
2022-08-28 18:12:17 +08:00
|
|
|
- unused
|
2019-01-12 00:29:49 +08:00
|
|
|
#- prealloc
|
|
|
|
#- maligned
|
|
|
|
disable-all: true
|
|
|
|
|
|
|
|
issues:
|
2019-02-09 19:25:05 +08:00
|
|
|
# Enable some lints excluded by default
|
|
|
|
exclude-use-default: false
|
|
|
|
|
2019-01-12 00:29:49 +08:00
|
|
|
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
|
2022-09-09 06:18:18 +08:00
|
|
|
max-issues-per-linter: 0
|
2019-01-12 00:29:49 +08:00
|
|
|
|
|
|
|
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
|
|
|
|
max-same-issues: 0
|
2021-10-15 22:58:52 +08:00
|
|
|
|
2022-08-21 02:54:18 +08:00
|
|
|
exclude-rules:
|
|
|
|
|
|
|
|
- linters:
|
|
|
|
- staticcheck
|
|
|
|
text: 'SA1019: "github.com/rclone/rclone/cmd/serve/httplib" is deprecated'
|
|
|
|
|
|
|
|
# TODO: Remove if/when this is fixed by merging PR #6277.
|
|
|
|
- linters:
|
|
|
|
- staticcheck
|
|
|
|
text: 'SA1019: "golang.org/x/oauth2/jws" is deprecated'
|
|
|
|
|
|
|
|
# TODO: Investigate if this is a real issue. If not, i.e. it is a false
|
|
|
|
# positive, consider instead excluding this check using a code comment!
|
|
|
|
- path: ^backend[\\/]crypt[\\/]cipher\.go$
|
|
|
|
linters:
|
|
|
|
- staticcheck
|
|
|
|
text: 'SA6002: argument should be pointer-like to avoid allocations'
|
|
|
|
|
|
|
|
# TODO: Investigate if this is a real issue. If not, i.e. it is a false
|
|
|
|
# positive, consider instead excluding this check using a code comment!
|
|
|
|
- path: ^backend[\\/]onedrive[\\/]onedrive\.go$
|
|
|
|
linters:
|
|
|
|
- staticcheck
|
|
|
|
text: 'SA4009: argument err is overwritten before first use'
|
|
|
|
|
|
|
|
# TODO: Investigate if this is a real issue. If not, i.e. it is a false
|
|
|
|
# positive, consider instead excluding this check using a code comment!
|
|
|
|
- path: ^backend[\\/]onedrive[\\/]onedrive\.go$
|
|
|
|
linters:
|
|
|
|
- staticcheck
|
|
|
|
text: 'SA4009\(related information\): assignment to err'
|
|
|
|
|
|
|
|
# TODO: Investigate if this is a real issue. If not, i.e. it is a false
|
|
|
|
# positive, consider instead excluding this check using a code comment!
|
|
|
|
- path: ^fs[\\/]pacer\.go$
|
|
|
|
linters:
|
|
|
|
- staticcheck
|
|
|
|
text: 'SA5007: infinite recursive call'
|
|
|
|
|
2021-10-15 22:58:52 +08:00
|
|
|
run:
|
|
|
|
# timeout for analysis, e.g. 30s, 5m, default is 1m
|
|
|
|
timeout: 10m
|
2023-03-20 22:17:18 +08:00
|
|
|
|
|
|
|
linters-settings:
|
|
|
|
revive:
|
|
|
|
rules:
|
|
|
|
- name: unreachable-code
|
|
|
|
disabled: true
|
|
|
|
- name: unused-parameter
|
|
|
|
disabled: true
|
|
|
|
- name: empty-block
|
|
|
|
disabled: true
|
|
|
|
- name: redefines-builtin-id
|
|
|
|
disabled: true
|
|
|
|
- name: superfluous-else
|
|
|
|
disabled: true
|
2022-08-20 19:35:58 +08:00
|
|
|
stylecheck:
|
|
|
|
# Only enable the checks performed by the staticcheck stand-alone tool,
|
|
|
|
# as documented here: https://staticcheck.io/docs/configuration/options/#checks
|
|
|
|
checks: ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022", "-ST1023"]
|