-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
42 lines (39 loc) · 1.6 KB
/
.golangci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
output:
formats:
- format: colored-line-number
path: stdout
linters:
enable:
# Default linters
- "errcheck" # Detect unchecked errors
- "gosimple" # Suggest code simplifications
- "govet" # Reports suspicious constructs
- "ineffassign" # Detects unused variable assignments
- "staticcheck" # go vet on steroids
- "typecheck" # Standard Go type checks
- "unused" # Detect unused constants, variables, functions and types
# Suggested additional linters
- "gocyclo" # or "cyclop", # Detect cyclomatic complexity
- "goconst" # Detect repeated values that can be made constants
- "gofumpt" # Or "gofmt", # Enforce standard formatting
- "goimports" # Ensure standard import formatting/ordering
# - "misspell" # Fix spelling errors
- "revive" # General purpose linter
- "unconvert" # Detect unnecessary type conversions
- "unparam" # Detect unused function parameters
# Optional
- "bodyclose" # Check whether HTTP response bodies are closed
- "goerr113" # Enforce standard error handling practices
#- "depguard" # Forbid certain package imports
- "dupl" # Detect duplicate code
#- "errchkjson" # some JSON-specific checks
#- "gomnd" # Magic number detection
- "nakedret" # Detect naked returns
#- "rowserrcheck" # Check whether Err of rows is checked
- "sqlclosecheck" # Ensure sql.Rows and sql.Stmt are closed
- "tparallel" # Detects inappropriate use of t.Parallel()
linters-settings:
gosimple:
checks:
- all
- '-S1023' # don't give err for pointless returns cause I prefer them for now