# v2.0.0. Created based on golangci-lint v2.6.1 version: "2" run: timeout: 5m modules-download-mode: readonly allow-serial-runners: true output: sort-order: - file - linter issues: max-issues-per-linter: 0 max-same-issues: 0 uniq-by-line: false # fix: true linters: exclusions: paths: - internal # TODO: Do not ignore interal packages rules: - linters: - err113 text: 'do not define dynamic errors, use wrapped static errors instead.*' - path: log/.*\\.go linters: - depguard # Exclude some linters from running on tests files. - path: _test\\.go linters: - bodyclose settings: depguard: rules: all: list-mode: lax deny: - pkg: "flag" desc: '`flag` package is only allowed in main.go' - pkg: "log" desc: 'logging is provided by `pkg/log`' - pkg: "io/ioutil" desc: '`io/ioutil` package is deprecated, use the `io` and `os` package instead' # TODO: Prevent using these without a reason # - pkg: "reflect" # desc: '`reflect` package is dangerous to use' # - pkg: "unsafe" # desc: '`unsafe` package is dangerous to use' errcheck: check-type-assertions: true check-blank: true disable-default-exclusions: true exclude-functions: - '(*bytes.Buffer).Write' # always returns nil error - '(*strings.Builder).WriteByte' # always returns nil error - '(*strings.Builder).WriteString' # always returns nil error errchkjson: report-no-exported: true exhaustive: default-signifies-exhaustive: true forbidigo: forbid: - pattern: ^print(ln)?$ - pattern: ^fmt\.Print(f|ln)?$ - pattern: ^http\.Default(Client|ServeMux|Transport)$ # TODO: Eventually enable these patterns # - ^panic$ # - ^time\.Sleep$ analyze-types: true goconst: numbers: true gocritic: # TODO: Uncomment the following lines enabled-tags: - diagnostic # - style # - performance # - experimental # - opinionated disabled-checks: - ifElseChain settings: captLocal: paramsOnly: false elseif: skipBalanced: false underef: skipRecvDeref: false # NOTE: Set this option to false if other projects rely on this project's code # unnamedResult: # checkExported: false gosec: excludes: - G104 # TODO: Enable this again. Mostly provided by errcheck - G115 config: global: # show-ignored: true # TODO: Enable this audit: true govet: enable-all: true disable: - fieldalignment - shadow grouper: # const-require-grouping: true # TODO: Enable this import-require-single-import: true import-require-grouping: true # var-require-grouping: true # TODO: Conflicts with gofumpt loggercheck: require-string-key: true no-printf-like: true misspell: locale: US nolintlint: require-explanation: true require-specific: true nonamedreturns: report-error-in-defer: true perfsprint: err-error: true predeclared: qualified-name: true promlinter: strict: true # TODO: Enable this # 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 disabled: true # TODO: Do not disable - name: cyclomatic disabled: true # TODO: Enable this check. Currently disabled due to upstream bug. # - name: enforce-repeated-arg-type-style # arguments: # - short - name: enforce-slice-style arguments: - make disabled: true # TODO: Do not disable - 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: max-public-structs disabled: true - name: modifies-parameter disabled: true - name: nested-structs disabled: true # TODO: Do not disable - name: package-comments disabled: true - name: optimize-operands-order disabled: true - name: unchecked-type-assertion disabled: true # TODO: Do not disable - name: unhandled-error disabled: true - name: enforce-switch-style disabled: true - name: var-naming disabled: true staticcheck: checks: - all - -QF1003 - -ST1000 - -ST1020 - -ST1021 - -ST1022 tagalign: strict: true tagliatelle: case: rules: json: snake testifylint: enable-all: true testpackage: skip-regexp: "^$" unparam: # NOTE: Set this option to false if other projects rely on this project's code check-exported: false unused: # TODO: Uncomment these two lines # parameters-are-used: false # local-variables-are-used: false # NOTE: Set these options to true if other projects rely on this project's code field-writes-are-uses: true # exported-is-used: true # TODO: Fix issues with this option (upstream) exported-fields-are-used: true usestdlibvars: http-method: true http-status-code: true time-weekday: false # TODO: Set to true time-month: false # TODO: Set to true time-layout: false # TODO: Set to true crypto-hash: true default-rpc-path: true sql-isolation-level: true tls-signature-scheme: true constant-kind: true wrapcheck: ignore-package-globs: - github.com/gofiber/utils/* - github.com/valyala/fasthttp enable: - asasalint - asciicheck - bidichk - bodyclose - containedctx - contextcheck # - cyclop - decorder - depguard - dogsled # - dupl # - dupword # TODO: Enable - durationcheck - errcheck - errchkjson - errname - errorlint - exhaustive # - exhaustivestruct # - exhaustruct - forbidigo - forcetypeassert # - funlen # - gci # TODO: Enable - ginkgolinter # - gocheckcompilerdirectives # TODO: Enable # - gochecknoglobals # TODO: Enable # - gochecknoinits # TODO: Enable - gochecksumtype # - gocognit # - goconst # TODO: Enable - gocritic # - gocyclo # - godot # - godox - err113 # - goheader # - goimports # - golint # - gomnd # TODO: Enable - gomoddirectives # - gomodguard - goprintffuncname - gosec # - gosmopolitan # TODO: Enable - govet - grouper # - ifshort # TODO: Enable # - importas # - inamedparam - ineffassign # - interfacebloat # - interfacer # - ireturn # - lll - loggercheck # - maintidx - makezero # - maligned - mirror - misspell - musttag - nakedret # - nestif - nilerr - nilnil # - nlreturn - noctx - nolintlint - nonamedreturns - nosprintfhostport # - paralleltest # TODO: Enable - perfsprint # - prealloc - predeclared - promlinter - protogetter - reassign - revive - rowserrcheck # - scopelint # TODO: Enable - sloglint - spancheck - sqlclosecheck - staticcheck # - stylecheck # TODO: Enable # - tagalign # TODO: Enable - tagliatelle - testableexamples - testifylint # - testpackage # TODO: Enable - thelper - tparallel - unconvert - unparam - unused - usestdlibvars # - varnamelen # - wastedassign # TODO: Enable - whitespace #- wrapcheck # - wsl - zerologlint formatters: enable: - gofmt - gofumpt settings: gci: sections: - standard - prefix(github.com/gofiber/utils) - default - blank - dot # - alias custom-order: true gofumpt: module-path: github.com/gofiber/utils extra-rules: true