build: add staticcheck, gosimple and stylecheck linting to the build pipeline - fixes #6273

These combined should correspond to the checks performed by the stand-alone
staticcheck tool, which is by default used for linting in Visual Studio Code
with the Go extension. One exception is the unused checks, which staticcheck
tool performs, but chose to not enabled here in rclone due to many reported
occurrences.

See #6387 for more information.
This commit is contained in:
albertony 2022-08-20 13:35:58 +02:00
parent f6576237a4
commit 8611c9f6f7

View File

@ -11,6 +11,10 @@ linters:
- varcheck - varcheck
- govet - govet
- unconvert - unconvert
- staticcheck
- gosimple
- stylecheck
#- unused
#- prealloc #- prealloc
#- maligned #- maligned
disable-all: true disable-all: true
@ -42,3 +46,7 @@ linters-settings:
disabled: true disabled: true
- name: superfluous-else - name: superfluous-else
disabled: true disabled: true
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"]