-
Notifications
You must be signed in to change notification settings - Fork 128
Expand file tree
/
Copy path.golangci.yaml
More file actions
67 lines (63 loc) · 2.1 KB
/
Copy path.golangci.yaml
File metadata and controls
67 lines (63 loc) · 2.1 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
# golangci-lint configuration (schema v2)
# https://golangci-lint.run/usage/configuration/
version: "2"
run:
# default concurrency is the available CPU number
concurrency: 8
# exit code when at least one issue was found, default is 1
issues-exit-code: 1
# pass -mod=readonly to "go list"; fails if go.mod needs updates (good for CI)
modules-download-mode: readonly
linters:
# start from the default set and enable extras below
default: standard
enable:
- errcheck
- govet
- ineffassign
- staticcheck
- unused
- gocritic
- unconvert
- unparam
- revive
settings:
revive:
# Historically the project ran golangci-lint via reviewdog, which only
# reports issues on changed lines, so the repo accumulated many missing
# doc-comments on already-exported symbols. These two rules are purely
# stylistic (documentation comments) and were never enforced repo-wide.
# We keep revive's substantive checks enabled but disable the doc-comment
# rules so the linter can run blocking over the whole module. Adding ~100
# doc comments is out of scope for the Go 1.26 / CVE upgrade.
rules:
- name: exported
disabled: true
- name: package-comments
disabled: true
staticcheck:
# Keep all SA* correctness checks enabled. Disable the cosmetic/stylistic
# checks that are out of scope for the Go 1.26 / CVE upgrade:
# QF* — "quickfix" simplifications (De Morgan, embedded-field selectors,
# tagged switches).
# ST1000 — "package should have a package comment" (the staticcheck
# equivalent of revive's package-comments, which we also disable;
# the repo historically never enforced doc comments repo-wide).
checks:
- all
- -QF1001
- -QF1003
- -QF1008
- -ST1000
exclusions:
# keep skipping generated and common vendored-style dirs
generated: lax
paths:
- tests/yor_plugins
formatters:
enable:
- gofmt
- goimports
issues:
max-issues-per-linter: 100
max-same-issues: 100