-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
65 lines (61 loc) · 1.85 KB
/
.golangci.yml
File metadata and controls
65 lines (61 loc) · 1.85 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
version: "2"
# NOTE: This config requires golangci-lint v2.6.1 or newer (see .dagger/runlint.go)
# Some linters like 'modernize' are not available in older versions
linters:
default: none
enable:
- modernize
- unused
- unparam
- staticcheck
- govet
- errorlint
- ineffassign
- depguard
- gosec # Security linter - detects SQL injection, command injection, etc.
# - nilerr # Routinely flags graceful degradation patterns as bugs (e.g., fallback to UID when name lookup fails)
settings:
gosec:
excludes:
- G306 # File permissions - config files appropriately use 0o644
- G404 # Weak random number generator - we use math/rand for non-security purposes (test data, sampling, etc.)
depguard:
rules:
prevent-flag-package:
files:
- "$all"
deny:
- pkg: "flag"
desc: "use github.com/spf13/cobra instead of the flag package"
staticcheck:
checks:
- all
- -QF1001 # De Morgan's law - whatever
- -ST1003 # Don't complain about naming conventions
- -ST1005 # Error strings capitalized - low impact, not worth AI agent iterations
- -S1039 # Unnecessary sprintf - low impact, not worth AI agent iterations
- -S1021 # Merge variable declaration - often needed for recursive functions
govet:
enable-all: true
disable:
- shadow # Don't complain about 'err' being shadowed
- fieldalignment # We don't care about field alignment
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- .*\.gen\.go$
- node_modules
- _gotools
- _build
- third_party$
- builtin$
- examples$
- .dagger/internal/.*
issues:
max-issues-per-linter: 0
max-same-issues: 0