Repository navigation
Expand file tree
/
Copy path.golangci.yml
More file actions
66 lines (63 loc) · 2.16 KB
/
Copy path.golangci.yml
File metadata and controls
66 lines (63 loc) · 2.16 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
# Copyright IBM Corp. 2018, 2026
# SPDX-License-Identifier: MPL-2.0
version: "2"
run:
timeout: 5m
linters:
# This set of linters are enabled by default: deadcode, errcheck, gosimple, govet, ineffasign, staticcheck, struccheck, typecheck, unused, varcheck
enable:
# List of all linters: https://golangci-lint.run/usage/linters/
- whitespace #https://github.com/ultraware/whitespace
# - noctx #https://github.com/sonatard/noctx
- nilerr #https://github.com/gostaticanalysis/nilerr
- nestif #https://github.com/nakabonne/nestif
- copyloopvar #https://github.com/karamaru-alpha/copyloopvar
- bodyclose #https://github.com/timakin/bodyclose
- goconst #https://github.com/jgautheron/goconst
- errcheck #https://github.com/kisielk/errcheck
- staticcheck # stylecheck/gosimple checks are part of staticcheck in v2
- revive #golint is deprecated and golangci-lint recommends to use revive instead https://github.com/mgechev/revive
#other deprecated lint libraries: maligned, scopelint, interfacer
- gocritic #https://github.com/go-critic/go-critic
- unparam #https://github.com/mvdan/unparam
- misspell #https://github.com/client9/misspell
exclusions:
rules:
- path: tfe_integration_test.go
linters:
- errcheck # Many calls in this test are known to return an error and not checked
- linters:
- staticcheck
text: "Ascii" # Permanently part of the public interface unless we break the API
- path: _test\.go
linters:
- errcheck
- goconst
- unused
- unparam
settings:
errcheck:
# https://github.com/kisielk/errcheck#excluding-functions
check-type-assertions: true
check-blank: true
goconst:
min-len: 20
min-occurrences: 5
ignore-calls: false
gocritic:
enabled-tags:
- diagnostic
- opinionated
- performance
disabled-checks:
- unnamedResult
- hugeParam
- singleCaseSwitch
- ifElseChain
revive:
severity: warning
rules:
- name: indent-error-flow #Prevents redundant else statements
severity: warning
- name: useless-break
severity: warning