Skip to content

Commit 32d7429

Browse files
committed
Update CI configs to v0.11.22
Update lint scripts and CI configs.
1 parent 0fe31cb commit 32d7429

File tree

2 files changed

+73
-69
lines changed

2 files changed

+73
-69
lines changed

.golangci.yml

Lines changed: 72 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,7 @@
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"
455
linters:
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,74 @@ 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+
# "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

.reuse/dep5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
22
Upstream-Name: Pion
33
Source: https://github.com/pion/
44

5-
Files: README.md DESIGN.md **/README.md AUTHORS.txt renovate.json go.mod go.sum **/go.mod **/go.sum .eslintrc.json package.json examples.json sfu-ws/flutter/.gitignore sfu-ws/flutter/pubspec.yaml c-data-channels/webrtc.h examples/examples.json
5+
Files: README.md DESIGN.md **/README.md AUTHORS.txt renovate.json go.mod go.sum **/go.mod **/go.sum .eslintrc.json package.json examples.json sfu-ws/flutter/.gitignore sfu-ws/flutter/pubspec.yaml c-data-channels/webrtc.h examples/examples.json yarn.lock
66
Copyright: 2023 The Pion community <https://pion.ly>
77
License: MIT
88

0 commit comments

Comments
 (0)