forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yaml
60 lines (56 loc) · 2.44 KB
/
.golangci.yaml
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
run:
timeout: 5m
tests: true
skip-dirs-use-default: true
service:
# Version is fixated to 1.47.3 because of https://github.com/golangci/golangci-lint-action/issues/535
# Until issue is fixed or repo go version is bumped to 1.19
golangci-lint-version: v1.47.3
linters:
disable-all: true
enable:
- whitespace # Tool for detection of leading and trailing whitespace
- unconvert # Unnecessary type conversions
- tparallel # Detects inappropriate usage of t.Parallel() method in your Go test codes
- thelper # Detects golang test helpers without t.Helper() call and checks the consistency of test helpers
- stylecheck # Stylecheck is a replacement for golint
- prealloc # Finds slice declarations that could potentially be pre-allocated
- predeclared # Finds code that shadows one of Go's predeclared identifiers
- nolintlint # Ill-formed or insufficient nolint directives
- misspell # Misspelled English words in comments
- makezero # Finds slice declarations with non-zero initial length
- importas # Enforces consistent import aliases
- gosec # Security problems
- gofmt # Whether the code was gofmt-ed
- goimports # Unused imports
- goconst # Repeated strings that could be replaced by a constant
#- forcetypeassert # Finds forced type assertions
- dogsled # Checks assignments with too many blank identifiers (e.g. x, , , _, := f())
#- dupl # Code clone detection
- errname # Checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
- errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13
linters-settings:
gofmt:
simplify: true
goconst:
min-len: 3
min-occurrences: 3
gosec:
excludes:
- G204 # Subprocess launched with a potential tainted input or cmd arguments
- G306 # Expect WriteFile permissions to be 0600 or less
stylecheck:
checks: [ "all", "-ST1022", "-ST1003" ]
errorlint:
asserts: false
issues:
whole-files: true
exclude-rules:
- path: _test\.go
linters:
- gosec # Disabled linting of weak number generators
- makezero # Disabled linting of intentional slice appends
- goconst # Disabled linting of common mnemonics and test case strings
- path: _\.gno
linters:
- errorlint # Disabled linting of error comparisons, because of lacking std lib support