123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284 |
- # Created based on v1.52.2
- # NOTE: Keep this in sync with the version in .github/workflows/lint_golangci-lint.yml
- run:
- timeout: 5m
- modules-download-mode: readonly
- skip-dirs-use-default: false
- skip-dirs:
- - internal
- output:
- sort-results: true
- linters-settings:
- depguard:
- include-go-root: true
- packages:
- - flag
- - io/ioutil
- - reflect
- - unsafe
- packages-with-error-message:
- - flag: '`flag` package is only allowed in main.go'
- - io/ioutil: '`io/ioutil` package is deprecated, use the `io` and `os` package instead'
- - reflect: '`reflect` package is dangerous to use'
- - unsafe: '`unsafe` package is dangerous to use'
- errcheck:
- check-type-assertions: true
- check-blank: true
- disable-default-exclusions: true
- errchkjson:
- report-no-exported: true
- exhaustive:
- check-generated: true
- default-signifies-exhaustive: true
- forbidigo:
- forbid:
- - ^(fmt\.Print(|f|ln)|print|println)$
- # - 'http\.Default(Client|Transport)'
- # - 'time\.Sleep'
- # - 'panic'
- gci:
- sections:
- - standard
- - prefix(github.com/gofiber/fiber)
- - default
- - blank
- - dot
- custom-order: true
- goconst:
- numbers: true
- gocritic:
- enabled-tags:
- - diagnostic
- - style
- - performance
- - experimental
- - opinionated
- disabled-checks:
- - hugeParam
- - rangeValCopy
- gofumpt:
- module-path: github.com/gofiber/template
- extra-rules: true
- gosec:
- config:
- global:
- audit: true
- govet:
- enable-all: true
- disable:
- - fieldalignment
- - shadow
- grouper:
- import-require-single-import: true
- import-require-grouping: true
- misspell:
- locale: US
- nolintlint:
- require-explanation: true
- require-specific: true
- nonamedreturns:
- report-error-in-defer: true
- predeclared:
- q: true
- promlinter:
- strict: true
- reassign:
- patterns:
- - '.*'
- revive:
- enable-all-rules: true
- rules:
- # Provided by gomnd linter
- - name: add-constant
- disabled: true
- - name: argument-limit
- disabled: true
- # Provided by bidichk
- - name: banned-characters
- disabled: true
- - name: cognitive-complexity
- disabled: true
- - name: comment-spacings
- arguments:
- - nolint
- - msgp
- - name: cyclomatic
- disabled: true
- - name: exported
- disabled: true
- - name: file-header
- disabled: true
- - name: function-result-limit
- arguments: [3]
- - name: function-length
- disabled: true
- - name: line-length-limit
- disabled: true
- - name: nested-structs
- disabled: true
- - name: max-public-structs
- disabled: true
- - name: modifies-parameter
- disabled: true
- - name: package-comments
- disabled: true
- - name: use-any
- disabled: true # some tests still use go 1.17
- stylecheck:
- checks:
- - all
- - -ST1000
- - -ST1020
- - -ST1021
- - -ST1022
- tagliatelle:
- case:
- rules:
- json: snake
- tenv:
- all: true
- #unparam:
- # check-exported: true
- wrapcheck:
- ignorePackageGlobs:
- - github.com/gofiber/fiber/*
- - github.com/valyala/fasthttp
- issues:
- exclude-use-default: false
- exclude-rules:
- - linters:
- - goerr113
- text: 'do not define dynamic errors, use wrapped static errors instead*'
- linters:
- enable:
- - asasalint
- - asciicheck
- - bidichk
- - bodyclose
- - containedctx
- - contextcheck
- # - cyclop
- - deadcode
- # - decorder
- - depguard
- - dogsled
- # - dupl
- - dupword
- - durationcheck
- - errcheck
- - errchkjson
- - errname
- - errorlint
- - execinquery
- - exhaustive
- # - exhaustivestruct
- # - exhaustruct
- - exportloopref
- - forbidigo
- - forcetypeassert
- # - funlen
- - gci
- - ginkgolinter
- - gocheckcompilerdirectives
- - gochecknoglobals # Enabled
- - gochecknoinits # Enabled
- # - gocognit
- - goconst
- - gocritic
- # - gocyclo
- # - godot
- # - godox
- - goerr113
- - gofmt
- - gofumpt
- # - goheader
- # - goimports
- # - golint
- - gomnd # Enabled
- - gomoddirectives
- # - gomodguard
- - goprintffuncname
- - gosec
- - gosimple
- - govet
- - grouper
- # - ifshort
- # - importas
- - ineffassign
- # - interfacebloat
- # - interfacer
- # - ireturn
- # - lll
- - loggercheck
- # - maintidx
- # - makezero
- # - maligned
- - misspell
- - musttag
- - nakedret
- # - nestif
- - nilerr
- - nilnil
- # - nlreturn
- - noctx
- - nolintlint
- - nonamedreturns
- - nosnakecase
- - nosprintfhostport
- - paralleltest
- # - prealloc
- - predeclared
- - promlinter
- - reassign
- - revive
- - rowserrcheck
- - scopelint
- - sqlclosecheck
- - staticcheck
- - structcheck
- - stylecheck
- - tagliatelle
- - tenv
- - testableexamples
- # - testpackage
- - thelper
- - tparallel
- - typecheck
- - unconvert
- - unparam
- - unused
- - usestdlibvars
- - varcheck
- # - varnamelen
- - wastedassign
- - whitespace
- # - wrapcheck # disabled
- # - wsl
|