forked from hashicorp/go-tfe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
67 lines (66 loc) · 2.28 KB
/
.golangci.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
65
66
67
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
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
- exportloopref #https://github.com/kyoh86/exportloopref
- bodyclose #https://github.com/timakin/bodyclose
- goconst #https://github.com/jgautheron/goconst
- gofmt
- errcheck #https://github.com/kisielk/errcheck
- stylecheck #https://github.com/dominikh/go-tools/tree/master/stylecheck
- 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
issues:
exclude-rules:
- path: tfe_integration_test.go
linters:
- errcheck # Many calls in this test are known to return an error and not checked
- linters:
- stylecheck
text: "Ascii" # Permanently part of the public interface unless we break the API
- path: _test\.go
linters:
- unused
- deadcode
- unparam
linters-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
ignore-tests: true
gocritic:
enabled-tags:
- diagnostic
- opinionated
- performance
disabled-checks:
- unnamedResult
- hugeParam
- singleCaseSwitch
- ifElseChain
- sloppyTestFuncName
revive:
# see https://github.com/mgechev/revive#available-rules for details.
ignore-generated-header: false #recommended in their configuration
severity: warning
rules:
- name: indent-error-flow #Prevents redundant else statements
severity: warning
- name: useless-break
severity: warning