mirror of
https://github.com/gofiber/fiber.git
synced 2025-05-01 05:01:48 +00:00
Globally ignore several methods that always return nil error. Disable revive and gosec rules for error checking in favor of errcheck.
231 lines
5.1 KiB
YAML
231 lines
5.1 KiB
YAML
# Created based on v1.51.0
|
|
# NOTE: Keep this in sync with the version in .github/workflows/linter.yml
|
|
|
|
run:
|
|
modules-download-mode: readonly
|
|
skip-dirs-use-default: false
|
|
skip-dirs:
|
|
- internal
|
|
|
|
output:
|
|
sort-results: true
|
|
|
|
linters-settings:
|
|
errcheck:
|
|
check-type-assertions: true
|
|
check-blank: true
|
|
disable-default-exclusions: true
|
|
exclude-functions:
|
|
- '(*bytes.Buffer).Write' # always returns nil error
|
|
- '(*github.com/valyala/bytebufferpool.ByteBuffer).Write' # always returns nil error
|
|
- '(*github.com/valyala/bytebufferpool.ByteBuffer).WriteByte' # always returns nil error
|
|
- '(*github.com/valyala/bytebufferpool.ByteBuffer).WriteString' # always returns nil error
|
|
|
|
errchkjson:
|
|
report-no-exported: true
|
|
|
|
exhaustive:
|
|
default-signifies-exhaustive: true
|
|
|
|
forbidigo:
|
|
forbid:
|
|
- ^(fmt\.Print(|f|ln)|print|println)$
|
|
- 'http\.Default(Client|Transport)'
|
|
# TODO: Eventually enable these patterns
|
|
# - 'time\.Sleep'
|
|
# - 'panic'
|
|
|
|
gocritic:
|
|
disabled-checks:
|
|
- ifElseChain
|
|
|
|
gofumpt:
|
|
module-path: github.com/gofiber/fiber
|
|
extra-rules: true
|
|
|
|
gosec:
|
|
excludes:
|
|
- G104 # Provided by errcheck
|
|
config:
|
|
global:
|
|
audit: true
|
|
|
|
depguard:
|
|
rules:
|
|
main:
|
|
deny:
|
|
- pkg: flag
|
|
desc: '`flag` package is only allowed in main.go'
|
|
- pkg: io/ioutil
|
|
desc: '`io/ioutil` package is deprecated, use the `io` and `os` package instead'
|
|
|
|
govet:
|
|
check-shadowing: true
|
|
enable-all: true
|
|
disable:
|
|
- shadow
|
|
- fieldalignment
|
|
- loopclosure
|
|
|
|
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
|
|
|
|
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
|
|
disabled: true # TODO https://github.com/gofiber/fiber/issues/2816
|
|
- name: cyclomatic
|
|
disabled: true
|
|
- name: early-return
|
|
severity: warning
|
|
disabled: true
|
|
- name: exported
|
|
disabled: true
|
|
arguments:
|
|
- disableStutteringCheck # TODO https://github.com/gofiber/fiber/issues/2816
|
|
- name: file-header
|
|
disabled: true
|
|
- name: function-result-limit
|
|
disabled: true
|
|
- 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
|
|
- name: package-comments
|
|
disabled: true
|
|
- name: unchecked-type-assertion
|
|
disabled: true # TODO https://github.com/gofiber/fiber/issues/2816
|
|
# Provided by errcheck
|
|
- name: unhandled-error
|
|
disabled: true
|
|
|
|
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
|
|
|
|
linters:
|
|
enable:
|
|
- asasalint
|
|
- asciicheck
|
|
- bidichk
|
|
- bodyclose
|
|
- containedctx
|
|
- contextcheck
|
|
- depguard
|
|
- dogsled
|
|
- durationcheck
|
|
- errcheck
|
|
- errchkjson
|
|
- errname
|
|
- errorlint
|
|
- execinquery
|
|
- exhaustive
|
|
- exportloopref
|
|
- forbidigo
|
|
- forcetypeassert
|
|
# - gochecksumtype # TODO https://github.com/gofiber/fiber/issues/2816
|
|
# - goconst # TODO https://github.com/gofiber/fiber/issues/2816
|
|
- gocritic
|
|
- gofmt
|
|
- gofumpt
|
|
- goimports
|
|
- gomoddirectives
|
|
- goprintffuncname
|
|
- gosec
|
|
- gosimple
|
|
# - gosmopolitan # TODO https://github.com/gofiber/fiber/issues/2816
|
|
- govet
|
|
- grouper
|
|
# - inamedparam # TODO https://github.com/gofiber/fiber/issues/2816
|
|
- loggercheck
|
|
# - mirror # TODO https://github.com/gofiber/fiber/issues/2816
|
|
- misspell
|
|
- nakedret
|
|
- nilerr
|
|
- nilnil
|
|
- noctx
|
|
- nolintlint
|
|
- nonamedreturns
|
|
- nosprintfhostport
|
|
# - perfsprint # TODO https://github.com/gofiber/fiber/issues/2816
|
|
- predeclared
|
|
- promlinter
|
|
- reassign
|
|
- revive
|
|
- rowserrcheck
|
|
- sqlclosecheck
|
|
- staticcheck
|
|
- stylecheck
|
|
# - tagalign # TODO https://github.com/gofiber/fiber/issues/2816
|
|
- tagliatelle
|
|
- testifylint
|
|
# - testpackage # TODO: Enable once https://github.com/gofiber/fiber/issues/2252 is implemented
|
|
- thelper
|
|
- tparallel
|
|
- typecheck
|
|
- unconvert
|
|
- unparam
|
|
- unused
|
|
- usestdlibvars
|
|
# - wastedassign # TODO https://github.com/gofiber/fiber/issues/2816
|
|
- whitespace
|
|
- wrapcheck
|
|
- tenv
|