diff --git a/.golangci.yml b/.golangci.yml index 390fd68..6f25e13 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,4 @@ -# v1.43.0 +# v1.55.2 # Please don't remove the first line. It uses in CI to determine the golangci version run: deadline: 5m @@ -10,7 +10,7 @@ issues: max-same-issues: 0 # We want to try and improve the comments in the k6 codebase, so individual - # non-golint items from the default exclusion list will gradually be addded + # non-golint items from the default exclusion list will gradually be added # to the exclude-rules below exclude-use-default: false @@ -25,10 +25,16 @@ issues: - funlen - lll - linters: - - paralleltest # false positive: https://github.com/kunwardeep/paralleltest/issues/8. - text: "does not use range value in test Run" + - staticcheck # Tracked in https://github.com/grafana/xk6-grpc/issues/14 + text: "The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated." + - linters: + - forbidigo + text: 'use of `os\.(SyscallError|Signal|Interrupt)` forbidden' linters-settings: + nolintlint: + # Disable to ensure that nolint directives don't have a leading space. Default is true. + allow-leading-space: false exhaustive: default-signifies-exhaustive: true govet: @@ -45,37 +51,79 @@ linters-settings: funlen: lines: 80 statements: 60 - goheader: - template-path: ".license-template" - values: - const: - year: "2022" - regexp: - year-range: (\d\d\d\d|{{year}}) + forbidigo: + forbid: + - '^(fmt\\.Print(|f|ln)|print|println)$' + # Forbid everything in os, except os.Signal and os.SyscalError + - '^os\.(.*)$(# Using anything except Signal and SyscallError from the os package is forbidden )?' + # Forbid everything in syscall except the uppercase constants + - '^syscall\.[^A-Z_]+$(# Using anything except constants from the syscall package is forbidden )?' + - '^logrus\.Logger$' linters: - enable-all: true - disable: - - nlreturn - - gci - - gochecknoinits - - godot - - godox - - gomodguard - - testpackage - - wsl - - gomnd - - goerr113 # most of the errors here are meant for humans - - goheader - - exhaustivestruct - - thelper - - gocyclo # replaced by cyclop since it also calculates the package complexity - - maligned # replaced by govet 'fieldalignment' - - interfacer # deprecated - - scopelint # deprecated, replaced by exportloopref - - wrapcheck # a little bit too much for k6, maybe after https://github.com/tomarrell/wrapcheck/issues/2 is fixed - - golint # this linter is deprecated - - varnamelen # disabled before the final decision in (https://github.com/grafana/k6/pull/2323) - - ireturn - - tagliatelle + disable-all: true + enable: + - asasalint + - asciicheck + - bidichk + - bodyclose + - contextcheck + - cyclop + - dogsled + - dupl + - durationcheck + - errcheck + - errchkjson + - errname + - errorlint + - exhaustive + - exportloopref + - forbidigo + - forcetypeassert + - funlen + - gocheckcompilerdirectives + - gochecknoglobals + - gocognit + - goconst + - gocritic + - gofmt + - gofumpt + - goimports + - gomoddirectives + - goprintffuncname + - gosec + - gosimple + - govet + - importas + - ineffassign + - interfacebloat + - lll + - makezero + - misspell + - nakedret + - nestif + - nilerr + - nilnil + - noctx + - nolintlint + - nosprintfhostport + - paralleltest + - prealloc + - predeclared + - promlinter + - revive + - reassign + - rowserrcheck + - sqlclosecheck + - staticcheck + - stylecheck + - tenv + - tparallel + - typecheck + - unconvert + - unparam + - unused + - usestdlibvars + - wastedassign + - whitespace fast: false