Skip to content

Commit fa10ad9

Browse files
committed
Update CI configs to v0.11.19
Update lint scripts and CI configs.
1 parent c85f51e commit fa10ad9

File tree

5 files changed

+44
-24
lines changed

5 files changed

+44
-24
lines changed

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
release:
2222
uses: pion/.goassets/.github/workflows/release.reusable.yml@master
2323
with:
24-
go-version: "1.22" # auto-update/latest-go-version
24+
go-version: "1.24" # auto-update/latest-go-version

.github/workflows/test.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: pion/.goassets/.github/workflows/test.reusable.yml@master
2424
strategy:
2525
matrix:
26-
go: ["1.23", "1.22"] # auto-update/supported-go-version-list
26+
go: ["1.24", "1.23"] # auto-update/supported-go-version-list
2727
fail-fast: false
2828
with:
2929
go-version: ${{ matrix.go }}
@@ -33,13 +33,13 @@ jobs:
3333
uses: pion/.goassets/.github/workflows/test-i386.reusable.yml@master
3434
strategy:
3535
matrix:
36-
go: ["1.23", "1.22"] # auto-update/supported-go-version-list
36+
go: ["1.24", "1.23"] # auto-update/supported-go-version-list
3737
fail-fast: false
3838
with:
3939
go-version: ${{ matrix.go }}
4040

4141
test-wasm:
4242
uses: pion/.goassets/.github/workflows/test-wasm.reusable.yml@master
4343
with:
44-
go-version: "1.23" # auto-update/latest-go-version
44+
go-version: "1.24" # auto-update/latest-go-version
4545
secrets: inherit

.github/workflows/tidy-check.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
tidy:
2323
uses: pion/.goassets/.github/workflows/tidy-check.reusable.yml@master
2424
with:
25-
go-version: "1.22" # auto-update/latest-go-version
25+
go-version: "1.24" # auto-update/latest-go-version

.golangci.yml

+38-18
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,42 @@ linters-settings:
1919
recommendations:
2020
- errors
2121
forbidigo:
22+
analyze-types: true
2223
forbid:
2324
- ^fmt.Print(f|ln)?$
2425
- ^log.(Panic|Fatal|Print)(f|ln)?$
2526
- ^os.Exit$
2627
- ^panic$
2728
- ^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
2844

2945
linters:
3046
enable:
3147
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
3248
- bidichk # Checks for dangerous unicode character sequences
3349
- bodyclose # checks whether HTTP response body is closed successfully
50+
- containedctx # containedctx is a linter that detects struct contained context.Context field
3451
- contextcheck # check the function whether use a non-inherited context
52+
- cyclop # checks function and package cyclomatic complexity
3553
- decorder # check declaration order and count of types, constants, variables and functions
3654
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
3755
- dupl # Tool for code clone detection
3856
- durationcheck # check for two durations multiplied together
57+
- err113 # Golang linter to check the errors handling expressions
3958
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
4059
- errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occations, where the check for the returned error can be omitted.
4160
- errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`.
@@ -46,66 +65,64 @@ linters:
4665
- forcetypeassert # finds forced type assertions
4766
- gci # Gci control golang package import order and make it always deterministic.
4867
- gochecknoglobals # Checks that no globals are present in Go code
49-
- gochecknoinits # Checks that no init functions are present in Go code
5068
- gocognit # Computes and checks the cognitive complexity of functions
5169
- goconst # Finds repeated strings that could be replaced by a constant
5270
- gocritic # The most opinionated Go source code linter
71+
- gocyclo # Computes and checks the cyclomatic complexity of functions
72+
- godot # Check if comments end in a period
5373
- godox # Tool for detection of FIXME, TODO and other comment keywords
54-
- err113 # Golang linter to check the errors handling expressions
5574
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
5675
- gofumpt # Gofumpt checks whether code was gofumpt-ed.
5776
- goheader # Checks is file header matches to pattern
5877
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports
5978
- gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod.
60-
- gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations.
6179
- goprintffuncname # Checks that printf-like functions are named with `f` at the end
6280
- gosec # Inspects source code for security problems
6381
- gosimple # Linter for Go source code that specializes in simplifying a code
6482
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
6583
- grouper # An analyzer to analyze expression groups.
6684
- importas # Enforces consistent import aliases
6785
- ineffassign # Detects when assignments to existing variables are not used
86+
- lll # Reports long lines
87+
- maintidx # maintidx measures the maintainability index of each function.
88+
- makezero # Finds slice declarations with non-zero initial length
6889
- misspell # Finds commonly misspelled English words in comments
90+
- nakedret # Finds naked returns in functions greater than a specified function length
91+
- nestif # Reports deeply nested if statements
6992
- nilerr # Finds the code that returns nil even if it checks that the error is not nil.
7093
- nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value.
94+
- nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity
7195
- noctx # noctx finds sending http request without context.Context
7296
- predeclared # find code that shadows one of Go's predeclared identifiers
7397
- revive # golint replacement, finds style mistakes
7498
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
7599
- stylecheck # Stylecheck is a replacement for golint
76100
- tagliatelle # Checks the struct tags.
77101
- tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17
78-
- tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes
102+
- thelper # thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers
79103
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
80104
- unconvert # Remove unnecessary type conversions
81105
- unparam # Reports unused function parameters
82106
- unused # Checks Go code for unused constants, variables, functions and types
107+
- varnamelen # checks that the length of a variable's name matches its scope
83108
- wastedassign # wastedassign finds wasted assignment statements
84109
- whitespace # Tool for detection of leading and trailing whitespace
85110
disable:
86111
- depguard # Go linter that checks if package imports are in a list of acceptable packages
87-
- containedctx # containedctx is a linter that detects struct contained context.Context field
88-
- cyclop # checks function and package cyclomatic complexity
89112
- funlen # Tool for detection of long functions
90-
- gocyclo # Computes and checks the cyclomatic complexity of functions
91-
- godot # Check if comments end in a period
92-
- gomnd # An analyzer to detect magic numbers.
113+
- gochecknoinits # Checks that no init functions are present in Go code
114+
- gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations.
115+
- interfacebloat # A linter that checks length of interface.
93116
- ireturn # Accept Interfaces, Return Concrete Types
94-
- lll # Reports long lines
95-
- maintidx # maintidx measures the maintainability index of each function.
96-
- makezero # Finds slice declarations with non-zero initial length
97-
- nakedret # Finds naked returns in functions greater than a specified function length
98-
- nestif # Reports deeply nested if statements
99-
- nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity
117+
- mnd # An analyzer to detect magic numbers
100118
- nolintlint # Reports ill-formed or insufficient nolint directives
101119
- paralleltest # paralleltest detects missing usage of t.Parallel() method in your Go test
102120
- prealloc # Finds slice declarations that could potentially be preallocated
103121
- promlinter # Check Prometheus metrics naming via promlint
104122
- rowserrcheck # checks whether Err of rows is checked successfully
105123
- sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed.
106124
- testpackage # linter that makes you use a separate _test package
107-
- thelper # thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers
108-
- varnamelen # checks that the length of a variable's name matches its scope
125+
- tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes
109126
- wrapcheck # Checks that errors returned from external packages are wrapped
110127
- wsl # Whitespace Linter - Forces you to use empty lines!
111128

@@ -114,9 +131,12 @@ issues:
114131
exclude-dirs-use-default: false
115132
exclude-rules:
116133
# Allow complex tests and examples, better to be self contained
117-
- path: (examples|main\.go|_test\.go)
134+
- path: (examples|main\.go)
118135
linters:
136+
- gocognit
119137
- forbidigo
138+
- path: _test\.go
139+
linters:
120140
- gocognit
121141

122142
# Allow forbidden identifiers in CLI commands

.reuse/dep5

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Files: README.md DESIGN.md **/README.md AUTHORS.txt renovate.json go.mod go.sum
66
Copyright: 2023 The Pion community <https://pion.ly>
77
License: MIT
88

9-
Files: testdata/fuzz/* **/testdata/fuzz/* api/*.txt
9+
Files: testdata/seed/* testdata/fuzz/* **/testdata/fuzz/* api/*.txt
1010
Copyright: 2023 The Pion community <https://pion.ly>
1111
License: CC0-1.0

0 commit comments

Comments
 (0)