-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy path.golangci.yml
More file actions
40 lines (38 loc) · 1.38 KB
/
Copy path.golangci.yml
File metadata and controls
40 lines (38 loc) · 1.38 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
# golangci-lint v2 config for feint. Standard linters plus security (gosec), correctness
# (errorlint, bodyclose) and hygiene (misspell, unconvert). Mirrors .pre-commit-config.yaml and
# the Go CI workflow.
version: "2"
linters:
default: standard # errcheck, govet, ineffassign, staticcheck, unused
enable:
- gosec # security: hardcoded creds, weak crypto, unsafe file APIs
- errorlint # %w / errors.Is misuse
- bodyclose # unclosed HTTP response bodies
- unconvert # redundant type conversions
- misspell
settings:
errcheck:
# Writing to the CLI's own stdout/stderr. There is nowhere left to report
# a failed write to the terminal, and the exit code already carries the
# outcome. Everything that writes a file stays checked, because a failed
# Close there means truncated data reported as success.
exclude-functions:
- fmt.Fprint
- fmt.Fprintf
- fmt.Fprintln
gosec:
excludes:
# feint opens files by paths the operator passes on the command line
# (state snapshot, coverage baseline). Inherent to a CLI, never untrusted
# web input.
- G304
exclusions:
generated: lax
rules:
# Tests legitimately use fixed credentials, temp paths and unchecked errors in fixtures.
- path: _test\.go
linters: [gosec]
formatters:
enable:
- gofmt
- goimports