-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy path.golangci.yaml
More file actions
80 lines (76 loc) · 2.47 KB
/
.golangci.yaml
File metadata and controls
80 lines (76 loc) · 2.47 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
version: "2"
linters:
enable:
# correctness
- govet
- errcheck
- staticcheck
- ineffassign
- unconvert
- bodyclose
# style / clarity
- revive
- gocritic
- misspell
- whitespace
# security
- gosec
# complexity
- gocyclo
settings:
gocyclo:
min-complexity: 20
revive:
rules:
- name: exported
arguments:
- disableStutteringCheck
gocritic:
enabled-tags:
- diagnostic
- style
- performance
disabled-checks:
- commentedOutCode
gosec:
excludes:
- G304 # file path from variable — expected in a CLI
- G204 # subprocess with variable — expected in a CLI
- G122 # filepath.Walk TOCTOU — acceptable for repo archiving
- G117 # secret field in marshaled struct — intentional (config file)
- G104 # unhandled errors — covered by errcheck with targeted exclusions
- G301 # directory permissions 0755 — intentional for static site output
- G306 # file write permissions 0644 — intentional for static site output
- G703 # path traversal — output paths come from user-supplied CLI flags
- G302 # executable file permissions 0755 — intentional for installed binaries
- G110 # decompression bomb — archives are from our own release downloads
exclusions:
rules:
# Deferred and best-effort closes are idiomatic Go — errors not actionable.
- text: 'Error return value of `.+\.Close` is not checked'
linters: [errcheck]
# fmt.Fprintf/Fprintln to stdout/stderr — write errors are not actionable.
- text: 'Error return value of `fmt\.Fp?rint'
linters: [errcheck]
# Best-effort temp file/dir cleanup.
- text: 'Error return value of `os\.Remove(All)?` is not checked'
linters: [errcheck]
# Ported packages from supermodeltools/arch-docs — style/complexity issues are
# acceptable in vendored/ported code; fixing them would cause needless upstream divergence.
- path: 'internal/archdocs/(graph2md|pssg)/'
linters: [gocritic, gocyclo, gosec, revive, ineffassign, staticcheck]
# Test files get more latitude.
- path: _test\.go
linters: [errcheck, gosec, gocritic]
formatters:
enable:
- goimports
settings:
goimports:
local-prefixes:
- github.com/supermodeltools/cli
issues:
max-issues-per-linter: 0
max-same-issues: 0
run:
timeout: 5m