-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.golangci.yml
More file actions
84 lines (73 loc) · 2.49 KB
/
.golangci.yml
File metadata and controls
84 lines (73 loc) · 2.49 KB
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
version: "2"
run:
timeout: 5m
tests: true
modules-download-mode: readonly
linters:
default: none
enable:
# Default linters
- errcheck # Check for unchecked errors
- govet # Reports suspicious constructs
- ineffassign # Detect ineffectual assignments
- staticcheck # Advanced static analysis (includes gosimple and stylecheck)
- unused # Check for unused code
# Additional quality linters
- misspell # Find commonly misspelled words
- unconvert # Remove unnecessary type conversions
- unparam # Report unused function parameters
- bodyclose # Check HTTP response body is closed
- noctx # Find sending http request without context.Context
- gosec # Security-focused linter
- gocritic # Most opinionated linter
- revive # Fast, configurable, extensible, flexible, and beautiful linter
- prealloc # Find slice declarations that could potentially be preallocated
- copyloopvar # Checks for pointers to enclosing loop variables (replaces exportloopref)
- nilerr # Finds code that returns nil even if it checks that error is not nil
- errorlint # Find code that will cause problems with error wrapping
- goprintffuncname # Checks that printf-like functions are named with f at the end
- nolintlint # Reports ill-formed or insufficient nolint directives
settings:
errcheck:
check-type-assertions: true
check-blank: true
govet:
enable-all: true
disable:
- fieldalignment # Too strict for most projects
gosec:
excludes:
- G404 # Use of weak random number generator - OK for non-crypto use
gocritic:
enabled-tags:
- diagnostic
- style
- performance
- experimental
- opinionated
disabled-checks:
- unnamedResult
- whyNoLint
revive:
rules:
- name: unexported-return
disabled: true
- name: unused-parameter
disabled: true
exclusions:
rules:
# Exclude some linters from running on tests files
- path: _test\.go
linters:
- gosec
- gocritic
- noctx
- bodyclose
# Exclude specific issues
- text: "G304: Potential file inclusion via variable"
linters:
- gosec
# Ignore long lines in generated files
- path: webfs_embed\.go
linters:
- lll