11# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
22# SPDX-License-Identifier: MIT
33
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"
455linters :
466 enable :
477 - asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
@@ -60,25 +20,19 @@ linters:
6020 - errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`.
6121 - 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.
6222 - exhaustive # check exhaustiveness of enum switch statements
63- - exportloopref # checks for pointers to enclosing loop variables
6423 - forbidigo # Forbids identifiers
6524 - forcetypeassert # finds forced type assertions
66- - gci # Gci control golang package import order and make it always deterministic.
6725 - gochecknoglobals # Checks that no globals are present in Go code
6826 - gocognit # Computes and checks the cognitive complexity of functions
6927 - goconst # Finds repeated strings that could be replaced by a constant
7028 - gocritic # The most opinionated Go source code linter
7129 - gocyclo # Computes and checks the cyclomatic complexity of functions
7230 - godot # Check if comments end in a period
7331 - 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.
7632 - goheader # Checks is file header matches to pattern
77- - goimports # Goimports does everything that gofmt does. Additionally it checks unused imports
7833 - gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod.
7934 - goprintffuncname # Checks that printf-like functions are named with `f` at the end
8035 - gosec # Inspects source code for security problems
81- - gosimple # Linter for Go source code that specializes in simplifying a code
8236 - govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
8337 - grouper # An analyzer to analyze expression groups.
8438 - importas # Enforces consistent import aliases
@@ -96,11 +50,8 @@ linters:
9650 - predeclared # find code that shadows one of Go's predeclared identifiers
9751 - revive # golint replacement, finds style mistakes
9852 - staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
99- - stylecheck # Stylecheck is a replacement for golint
10053 - tagliatelle # Checks the struct tags.
101- - tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17
10254 - 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
10455 - unconvert # Remove unnecessary type conversions
10556 - unparam # Reports unused function parameters
10657 - unused # Checks Go code for unused constants, variables, functions and types
@@ -125,21 +76,72 @@ linters:
12576 - tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes
12677 - wrapcheck # Checks that errors returned from external packages are wrapped
12778 - 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+ - -QF1008 # "could remove embedded field", to keep it explicit!
84+ - -QF1003 # "could use tagged switch on enum", Cases conflicts with exhaustive!
85+ exhaustive :
86+ default-signifies-exhaustive : true
87+ forbidigo :
88+ forbid :
89+ - pattern : ^fmt.Print(f|ln)?$
90+ - pattern : ^log.(Panic|Fatal|Print)(f|ln)?$
91+ - pattern : ^os.Exit$
92+ - pattern : ^panic$
93+ - pattern : ^print(ln)?$
94+ - pattern : ^testing.T.(Error|Errorf|Fatal|Fatalf|Fail|FailNow)$
95+ pkg : ^testing$
96+ msg : use testify/assert instead
97+ analyze-types : true
98+ gomodguard :
99+ blocked :
100+ modules :
101+ - github.com/pkg/errors :
102+ recommendations :
103+ - errors
104+ govet :
105+ enable :
106+ - shadow
107+ revive :
108+ rules :
109+ # Prefer 'any' type alias over 'interface{}' for Go 1.18+ compatibility
110+ - name : use-any
111+ severity : warning
112+ disabled : false
113+ misspell :
114+ locale : US
115+ varnamelen :
116+ max-distance : 12
117+ min-name-length : 2
118+ ignore-type-assert-ok : true
119+ ignore-map-index-ok : true
120+ ignore-chan-recv-ok : true
121+ ignore-decls :
122+ - i int
123+ - n int
124+ - w io.Writer
125+ - r io.Reader
126+ - b []byte
127+ exclusions :
128+ generated : lax
129+ rules :
130+ - linters :
131+ - forbidigo
132+ - gocognit
133+ path : (examples|main\.go)
134+ - linters :
135+ - gocognit
136+ path : _test\.go
137+ - linters :
138+ - forbidigo
139+ path : cmd
140+ formatters :
141+ enable :
142+ - gci # Gci control golang package import order and make it always deterministic.
143+ - gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
144+ - gofumpt # Gofumpt checks whether code was gofumpt-ed.
145+ - goimports # Goimports does everything that gofmt does. Additionally it checks unused imports
146+ exclusions :
147+ generated : lax
0 commit comments