-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yaml
78 lines (76 loc) · 3.28 KB
/
.golangci.yaml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
run:
go: "1.22"
linters:
# default enabled linters: errcheck, gosimple, govet, ineffassign, staticcheck, typecheck, unused
enable:
- bodyclose # checks whether HTTP response body is closed successfully
- exportloopref # checks for pointers to enclosing loop variables
- forbidigo # forbids identifiers
- funlen # tool for detection of long functions
- gci # controls Go package import order and makes it always deterministic.
- gocheckcompilerdirectives # validates go compiler directive comments (//go:)
- gocritic # provides diagnostics that check for bugs, performance and style issues
- gocyclo # computes and checks the cyclomatic complexity of functions
- godox # detects fix_me, to_do and other comment keywords
- govet # examines Go source code and reports suspicious constructs
- lll # reports long lines
- nolintlint # reports ill-formed or insufficient nolint directives
- predeclared # finds code that shadows one of Go's predeclared identifiers
- reassign # checks that package variables are not reassigned
- revive # fast, configurable, extensible, flexible linter for Go, drop-in replacement of golint
- unconvert # removes unnecessary type conversions
- unparam # reports unused function parameters
- usestdlibvars # detects the possibility to use variables/constants from the Go standard library
- unused # reports unused constants, variables, functions and types.
- wastedassign # finds wasted assignment statements
- whitespace # detects leading and trailing whitespace
linters-settings:
staticcheck:
checks: ["all", "-SA1029"] # SA1029: should not use built-in type string as key for value
errcheck:
check-type-assertions: true
gci:
skip-generated: true
custom-order: true
sections:
- standard
- default
- prefix(github.com)
- prefix(gopkg.in)
- prefix(scm.code.telecomitalia.it)
govet:
enable-all: true
funlen:
statements: 50
lll:
line-length: 120
nolintlint:
require-explanation: true
gocyclo: # complexity increases by 1 for each 'if', 'for', 'case', '&&' or '||'
min-complexity: 10
forbidigo:
forbid:
- ^print.*$ # proibisce solo l'utilizzo delle funzioni di debug
revive:
rules: #https://golangci-lint.run/usage/linters/#revive
- name: exported # Exported function and methods should have comments
arguments:
- disableStutteringCheck
- name: argument-limit #Warns when a function receives more parameters than the maximum set by the rule
arguments: [3]
issues: # https://golangci-lint.run/usage/configuration/#issues-configuration
exclude-rules:
- path: _test\.go # disable some linters on test files
linters:
- gosec
- usestdlibvars
- funlen # tool for detection of long functions
- godot # checks if comments end in a period
- godox # detects fix_me, to_do and other comment keywords
- govet
- lll # reports long lines
- nilnil
- whitespace # detects leading and trailing whitespace
include:
- EXC0012 # EXC0012 revive: Annoying issue about not having a comment. The rare codebase has such comments
- EXC0014 # EXC0014 revive: Annoying issue about not having a comment. The rare codebase has such comment