-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.golangci-strict.yml
More file actions
50 lines (50 loc) · 1.57 KB
/
Copy path.golangci-strict.yml
File metadata and controls
50 lines (50 loc) · 1.57 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
# NEW-CODE-ONLY quality ratchet — run via `make lint-strict`.
#
# Enables the complexity/size/quality linters that the legacy codebase
# does NOT yet pass (the 1000+ line god-functions: initHTTPServer,
# executeWorkflowAttempt, PlaceOrderWithCaps, ...). To raise the standard
# WITHOUT a flood of legacy findings, `issues.new-from-merge-base` scopes
# reporting to code added/changed since the merge-base with origin/main —
# so existing code is grandfathered but every new function is held to the
# bar. golangci-lint's new-from is global, hence this is a SECOND config
# (the default linters stay full-codebase in .golangci.yml).
#
# CI note (for when remote CI is unblocked): on a direct-to-main push,
# merge-base == HEAD reports nothing; the CI step should instead pass
# `--new-from-rev=<before-sha>` (e.g. GitHub's `${{ github.event.before }}`)
# so each push's new commits are checked. Locally and on PR branches the
# merge-base default below is correct. Requires full git history
# (fetch-depth: 0 in CI).
version: "2"
linters:
default: none
enable:
- funlen
- gocognit
- nestif
- dupl
- gocritic
- revive
- unparam
- unconvert
settings:
funlen:
lines: 80
statements: 60
gocognit:
min-complexity: 30
nestif:
min-complexity: 8
dupl:
threshold: 150
exclusions:
rules:
# Tests may legitimately be long / repetitive (table cases, fixtures).
- path: _test\.go
linters:
- funlen
- gocognit
- dupl
- nestif
issues:
new-from-merge-base: origin/main