From 7f9d34c82c053d37a72d6cb9109a1f66b69376e6 Mon Sep 17 00:00:00 2001 From: ivvist Date: Mon, 5 Feb 2024 16:54:21 +0100 Subject: [PATCH] new linters added --- scripts/.golangci.yml | 53 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/scripts/.golangci.yml b/scripts/.golangci.yml index f74a74e..f13b5e7 100644 --- a/scripts/.golangci.yml +++ b/scripts/.golangci.yml @@ -1,4 +1,6 @@ # options for analysis running +# https://golangci-lint.run/usage/linters/ + linters: disable-all: true enable: @@ -9,11 +11,44 @@ linters: - stylecheck - misspell - errcheck + - bidichk + +# First stage linters - asciicheck # Checks that all code identifiers does not have non-ASCII symbols in the name - durationcheck # Check for two durations multiplied together - gochecknoinits # Checks that no init functions are present in Go code. - gomnd + +# Second stage linters +# - unconvert # Remove unnecessary type conversions. +# - predeclared # Find code that shadows one of Go's predeclared identifiers. +# - mirror # Reports wrong mirror patterns of bytes/strings usage. +# - nilerr # Finds the code that returns nil even if it checks that the error is not nil. +# - testifylint # Checks usage of github.com/stretchr/testify. + + +# For the future: +#------------------------------------ +# - testpackage +# - prealloc +# - perfsprint +# - nonamedreturns +# - noctx +# - nilnil +#? - nestif +# - musttag +# - makezero +# - inamedparam +# - goerr113 +# - godox #- searches FixMe,TODO in code +# - gocritic +# - forbidigo +# - exportloopref +# - exhaustruct +# - errorlint +# - goconst # - unparam +#------------------------------------ fast: true linters-settings: gosec: @@ -21,10 +56,10 @@ linters-settings: - G101 - G601 - G602 - stylecheck: - checks: [ "all", "-ST1003", "-ST1023", "-ST1022" ] staticcheck: checks: [ "all", "-SA1019"] + stylecheck: + checks: [ "all", "-ST1003", "-ST1023" ] unparam: check-exported: true misspell: @@ -44,6 +79,19 @@ linters-settings: allowStrs: '""' allowInts: "0,1,2" allowFloats: "0.0,0.,1.0,1.,2.0,2." + gomnd: + ignored-files: + - "pkg/vit/consts.go" + ignored-numbers: + - "0" + - "1" + - "2" + - "3" + - "4" + - "5" + - "10" + - "42" + - "100" issues: exclude: - underscore @@ -55,4 +103,3 @@ issues: - gosec - errcheck - forcetypeassert -