forked from opentofu/opentofu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci-complexity.yml
64 lines (55 loc) · 1.52 KB
/
.golangci-complexity.yml
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
# Copyright (c) The OpenTofu Authors
# SPDX-License-Identifier: MPL-2.0
# Copyright (c) 2023 HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
# This is a temporary variant of .golangci.yml to support our work on improving
# existing functions to pass the code complexity lint rules:
# https://github.com/opentofu/opentofu/issues/2325
#
# If you are working on the code complexity improvement project then you can
# check our progress on the complexity-related lints by running the linters
# as follows:
# golangci-lint run -c .golangci-complexity.yml
#
# Many existing functions were failing multiple linters at once at the start
# of this project, and for as long as that remains true it might be helpful
# to add the --uniq-by-line=false option to review all of the failures at
# once.
#
# This file should be deleted at the same time as we re-enable the five
# complexity-related linters in .golangci.yml.
run:
timeout: 30m
linters-settings:
funlen:
lines: 100
statements: 50
ignore-comments: true
nolintlint:
require-explanation: true
require-specific: true
cyclop:
max-complexity: 20
gocognit:
min-complexity: 50
nestif:
min-complexity: 6
issues:
exclude-rules:
- path: (.+)_test.go
linters:
- funlen
- dupl
- revive
- path: (.+)_test.go
text: "ST1003"
- path: (.+)_test.go
text: "var-naming: don't use underscores in Go names"
linters:
disable-all: true
enable:
- cyclop
- funlen
- gocognit
- gocyclo
- nestif