-
Notifications
You must be signed in to change notification settings - Fork 2
/
.golangci.yml
78 lines (71 loc) · 2.94 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
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:
skip-dirs:
- "cmd/test"
tests: false
linters-settings:
errcheck:
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: true
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: true
govet:
# report about shadowed variables
check-shadowing: true
# Enable all analyzers
enable-all: true
lll:
# max line length, lines longer will be reported. Default is 120.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
line-length: 120
# tab width in spaces. Default to 1.
tab-width: 4
misspell:
# Correct spellings using locale preferences for US or UK.
# Default is to use a neutral variety of English.
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
locale: US
ignore-words: []
# We want to keep the amount of dependencies to a minimum, so we use a whitelist here.
# This list is not automatically mutated by the go toolchain and thus provides a manual sanity check.
depguard:
list-type: whitelist
include-go-root: false
packages:
- github.com/cilium/ebpf
- golang.org/x/sys
- github.com/google/gopacket
linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- govet # Check for common errors
- errcheck # Check for missing error handling
- staticcheck # Adds extra checks on top of govet
- gosimple # Check for code which can be simpeler
- structcheck # Check for unused struct fields
- varcheck # Check for unused globals and consts
- ineffassign # Check for ineffectual assignments
- deadcode # Check for dead/unreachable code
- bodyclose # Check for unclosed HTTP bodies (causes resource leaking)
- gofmt # Check for code formatting
- gofumpt # Is stricter than gofmt
- gosec # Inspects source code for security problems
- unconvert # Remove unnecessary type conversions
- misspell # Finds commonly misspelled English words in comments
- lll # Reports long lines
- revive # A maintained replacement for golint
- depguard # Make sure we don't accidentally dependencies
# - golint # Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes
# DO NOT ENABLE
# unused gives lots of false positives
# - unused # Check for unused consts, variables, functions and types
# golint is depricated
issues:
exclude-rules:
# fieldalignment is an optimization which often is traded of for readability of a struct
- text: "fieldalignment:"
linters:
- govet