-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
133 lines (117 loc) · 3.87 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
run:
# Timeout for analysis, e.g. 30s, 5m.
timeout: 5m
# Exit code when at least one issue was found.
# Default: 1
issue-exit-code: 1
# Include test files or not.
# Default: true
tests: true
# Enables skipping of directories:
# - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
# Default: true
skip-dirs-use-default: true
# Default empty, allowed options are readonly, vendor and mod.
modules-download-mode: readonly
# Define the Go version limit.
# Mainly related to generics support since go1.18.
# Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.18
# Intentionally left empty to use go.mod's Go version
go: ""
issues:
# Set to 0 to not skip any issues.
max-issues-per-linter: 0
# Set to 0 to not skip any issues.
max-same-issues: 0
# Show only new issues: if there are unstaged changes or untracked files,
# only those changes are analyzed, else only changes in HEAD~ are analyzed.
# It's a super-useful option for integration of golangci-lint into existing large codebase.
# It's not practical to fix all existing issues at the moment of integration:
# much better don't allow issues in new code.
#
# Default: false.
new: false
output:
# Print linter name in the end of issue text.
# Default: true
print-linter-name: true
# Sort results by: filepath, then line, then column.
sort-results: true
# Make issues output unique by line.
# Default: true
uniq-by-line: false
# Print lines of code with issue.
# Default: true
print-issued-lines: true
linters:
# Disable all linters.
# Default: false
disable-all: true
# Run only fast linters from enabled linters set (first run won't be fast)
# Default: false
fast: false
# Enable specific linter
# https://golangci-lint.run/usage/linters/#enabled-by-default
enable:
# Check for dangerous unicode character sequences.
- bidichk
# Check whether the HTTP response body is closed properly.
- bodyclose
# Detect context.Context contained in structs.
- containedctx
# Check whether a function uses a non-inherited context.
- contextcheck
# Find declarations and assignments with too many blank identifiers.
- dogsled
# Check for unchecked errors.
- errcheck
# Find code that will cause problems with the error wrapping scheme.
- errorlint
# Find exporting pointers for loop variables.
- exportloopref
# Inspects source code for security problems.
- gosec
# Enforce standards for ginkgo and gomega.
- ginkgolinter
# Check that compiler directives are valid.
- gocheckcompilerdirectives
# Calculate cognitive complexities of functions.
- gocognit
# Find repeated strings that could be replaced by a constant.
- goconst
# Provides functionalities missing from other linters.
- gocritic
# Calculates cyclomatic complexity of a function.
- gocyclo
# Check if comments end with a dot (NOTICE: this is not the Godot game engine).
- godot
# A stricter replacement for gofmt.
- gofumpt
# GO Magic Number Detector.
- gomnd
# Simplify the code.
- gosimple
# Check for correctness of programs.
- govet
# Detect ineffectual assignments.
- ineffassign
# Correct commonly misspelled English words in source files.
- misspell
# Find incorrect usages of t.Parallel().
- paralleltest
# Drop-in replacement of golint.
- revive
# Find bugs and performance issues statically.
- staticcheck
# Parse and type-check Go code.
- typecheck
# Checks Go code for unused constants, variables, functions and types.
- unused
# Empty lines linter.
- wsl
# Setting of specific linters.
linters-settings:
paralleltest:
# Ignore missing calls to `t.Parallel()` and only report incorrect uses of it.
# Default: false
ignore-missing: true