1
1
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
2
2
# SPDX-License-Identifier: MIT
3
3
4
- run :
5
- timeout : 5m
6
-
7
- linters-settings :
8
- govet :
9
- enable :
10
- - shadow
11
- misspell :
12
- locale : US
13
- exhaustive :
14
- default-signifies-exhaustive : true
15
- gomodguard :
16
- blocked :
17
- modules :
18
- - github.com/pkg/errors :
19
- recommendations :
20
- - errors
21
- forbidigo :
22
- analyze-types : true
23
- forbid :
24
- - ^fmt.Print(f|ln)?$
25
- - ^log.(Panic|Fatal|Print)(f|ln)?$
26
- - ^os.Exit$
27
- - ^panic$
28
- - ^print(ln)?$
29
- - p : ^testing.T.(Error|Errorf|Fatal|Fatalf|Fail|FailNow)$
30
- pkg : ^testing$
31
- msg : " use testify/assert instead"
32
- varnamelen :
33
- max-distance : 12
34
- min-name-length : 2
35
- ignore-type-assert-ok : true
36
- ignore-map-index-ok : true
37
- ignore-chan-recv-ok : true
38
- ignore-decls :
39
- - i int
40
- - n int
41
- - w io.Writer
42
- - r io.Reader
43
- - b []byte
44
-
4
+ version : " 2"
45
5
linters :
46
6
enable :
47
7
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
@@ -60,25 +20,19 @@ linters:
60
20
- errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`.
61
21
- 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.
62
22
- exhaustive # check exhaustiveness of enum switch statements
63
- - exportloopref # checks for pointers to enclosing loop variables
64
23
- forbidigo # Forbids identifiers
65
24
- forcetypeassert # finds forced type assertions
66
- - gci # Gci control golang package import order and make it always deterministic.
67
25
- gochecknoglobals # Checks that no globals are present in Go code
68
26
- gocognit # Computes and checks the cognitive complexity of functions
69
27
- goconst # Finds repeated strings that could be replaced by a constant
70
28
- gocritic # The most opinionated Go source code linter
71
29
- gocyclo # Computes and checks the cyclomatic complexity of functions
72
30
- godot # Check if comments end in a period
73
31
- godox # Tool for detection of FIXME, TODO and other comment keywords
74
- - gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
75
- - gofumpt # Gofumpt checks whether code was gofumpt-ed.
76
32
- goheader # Checks is file header matches to pattern
77
- - goimports # Goimports does everything that gofmt does. Additionally it checks unused imports
78
33
- gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod.
79
34
- goprintffuncname # Checks that printf-like functions are named with `f` at the end
80
35
- gosec # Inspects source code for security problems
81
- - gosimple # Linter for Go source code that specializes in simplifying a code
82
36
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
83
37
- grouper # An analyzer to analyze expression groups.
84
38
- importas # Enforces consistent import aliases
@@ -96,11 +50,8 @@ linters:
96
50
- predeclared # find code that shadows one of Go's predeclared identifiers
97
51
- revive # golint replacement, finds style mistakes
98
52
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
99
- - stylecheck # Stylecheck is a replacement for golint
100
53
- tagliatelle # Checks the struct tags.
101
- - tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17
102
54
- thelper # thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers
103
- - typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
104
55
- unconvert # Remove unnecessary type conversions
105
56
- unparam # Reports unused function parameters
106
57
- unused # Checks Go code for unused constants, variables, functions and types
@@ -125,21 +76,74 @@ linters:
125
76
- tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes
126
77
- wrapcheck # Checks that errors returned from external packages are wrapped
127
78
- wsl # Whitespace Linter - Forces you to use empty lines!
128
-
129
- issues :
130
- exclude-use-default : false
131
- exclude-dirs-use-default : false
132
- exclude-rules :
133
- # Allow complex tests and examples, better to be self contained
134
- - path : (examples|main\.go)
135
- linters :
136
- - gocognit
137
- - forbidigo
138
- - path : _test\.go
139
- linters :
140
- - gocognit
141
-
142
- # Allow forbidden identifiers in CLI commands
143
- - path : cmd
144
- linters :
145
- - forbidigo
79
+ settings :
80
+ staticcheck :
81
+ checks :
82
+ - all
83
+ # "could remove embedded field", to keep it explicit!
84
+ - -QF1008
85
+ # "could use tagged switch on enum", Cases conflicts with exhaustive!
86
+ - -QF1003
87
+ exhaustive :
88
+ default-signifies-exhaustive : true
89
+ forbidigo :
90
+ forbid :
91
+ - pattern : ^fmt.Print(f|ln)?$
92
+ - pattern : ^log.(Panic|Fatal|Print)(f|ln)?$
93
+ - pattern : ^os.Exit$
94
+ - pattern : ^panic$
95
+ - pattern : ^print(ln)?$
96
+ - pattern : ^testing.T.(Error|Errorf|Fatal|Fatalf|Fail|FailNow)$
97
+ pkg : ^testing$
98
+ msg : use testify/assert instead
99
+ analyze-types : true
100
+ gomodguard :
101
+ blocked :
102
+ modules :
103
+ - github.com/pkg/errors :
104
+ recommendations :
105
+ - errors
106
+ govet :
107
+ enable :
108
+ - shadow
109
+ revive :
110
+ rules :
111
+ # Prefer 'any' type alias over 'interface{}' for Go 1.18+ compatibility
112
+ - name : use-any
113
+ severity : warning
114
+ disabled : false
115
+ misspell :
116
+ locale : US
117
+ varnamelen :
118
+ max-distance : 12
119
+ min-name-length : 2
120
+ ignore-type-assert-ok : true
121
+ ignore-map-index-ok : true
122
+ ignore-chan-recv-ok : true
123
+ ignore-decls :
124
+ - i int
125
+ - n int
126
+ - w io.Writer
127
+ - r io.Reader
128
+ - b []byte
129
+ exclusions :
130
+ generated : lax
131
+ rules :
132
+ - linters :
133
+ - forbidigo
134
+ - gocognit
135
+ path : (examples|main\.go)
136
+ - linters :
137
+ - gocognit
138
+ path : _test\.go
139
+ - linters :
140
+ - forbidigo
141
+ path : cmd
142
+ formatters :
143
+ enable :
144
+ - gci
145
+ - gofmt
146
+ - gofumpt
147
+ - goimports
148
+ exclusions :
149
+ generated : lax
0 commit comments