Skip to content

Instantly share code, notes, and snippets.

@SkYNewZ
Created November 14, 2023 21:53
Show Gist options
  • Save SkYNewZ/1298ddacb28d23738a9498509765baae to your computer and use it in GitHub Desktop.
Save SkYNewZ/1298ddacb28d23738a9498509765baae to your computer and use it in GitHub Desktop.
.golangci.yaml golden configuration
# Inspired from https://gist.github.com/maratori/47a4d00457a92aa426dbd48a18776322
run:
timeout: 5m
modules-download-mode: readonly
linters:
enable-all: true
disable:
- bodyclose
- cyclop
- depguard
- dupl
- exhaustivestruct
- exhaustruct
- forcetypeassert
- funlen
- gci
- gochecknoglobals
- godox
- gomnd
- ireturn
- lll
- nlreturn
- scopelint
- sloglint
- tagliatelle
- varnamelen
- wsl
# deprecated
- deadcode
- golint
- ifshort
- interfacer
- maligned
- nosnakecase
- scopelint
- structcheck
- varcheck
linters-settings:
forbidigo:
# Forbid the following identifiers (list of regexp).
forbid:
- ^(fmt\\.Print(|f|ln)|print|println)$
- ^panic.*$
# goimports:
# Group imports by 3rd party and local
# local-prefixes: github.com/SkYNewZ
govet:
# Enable all analyzers.
# Default: false
enable-all: true
# Disable analyzers by name.
# Run `go tool vet help` to see all analyzers.
# Default: []
disable:
- fieldalignment # too strict
tenv:
# The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures.
# Otherwise, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked.
# Default: false
all: true
issues:
# Maximum count of issues with the same text.
# Set to 0 to disable.
# Default: 3
max-same-issues: 50
exclude-rules:
- path: "_test\\.go"
linters:
- bodyclose
- dupl
- funlen
- goconst
- gosec
- noctx
- wrapcheck
- containedctx
- govet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment