Update CI configs to v0.11.15

Update lint scripts and CI configs.
This commit is contained in:
Pion
2024-08-16 12:26:32 -04:00
committed by Sean DuBois
parent 5d9b189feb
commit bf68674e63
5 changed files with 12 additions and 12 deletions
+3 -3
View File
@@ -23,7 +23,7 @@ jobs:
uses: pion/.goassets/.github/workflows/test.reusable.yml@master
strategy:
matrix:
go: ["1.22", "1.21"] # auto-update/supported-go-version-list
go: ["1.23", "1.22"] # auto-update/supported-go-version-list
fail-fast: false
with:
go-version: ${{ matrix.go }}
@@ -33,7 +33,7 @@ jobs:
uses: pion/.goassets/.github/workflows/test-i386.reusable.yml@master
strategy:
matrix:
go: ["1.22", "1.21"] # auto-update/supported-go-version-list
go: ["1.23", "1.22"] # auto-update/supported-go-version-list
fail-fast: false
with:
go-version: ${{ matrix.go }}
@@ -41,5 +41,5 @@ jobs:
test-wasm:
uses: pion/.goassets/.github/workflows/test-wasm.reusable.yml@master
with:
go-version: "1.22" # auto-update/latest-go-version
go-version: "1.23" # auto-update/latest-go-version
secrets: inherit
+4 -4
View File
@@ -1,6 +1,9 @@
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
# SPDX-License-Identifier: MIT
run:
timeout: 5m
linters-settings:
govet:
enable:
@@ -48,7 +51,7 @@ linters:
- goconst # Finds repeated strings that could be replaced by a constant
- gocritic # The most opinionated Go source code linter
- godox # Tool for detection of FIXME, TODO and other comment keywords
- goerr113 # Golang linter to check the errors handling expressions
- err113 # Golang linter to check the errors handling expressions
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
- gofumpt # Gofumpt checks whether code was gofumpt-ed.
- goheader # Checks is file header matches to pattern
@@ -83,17 +86,14 @@ linters:
- depguard # Go linter that checks if package imports are in a list of acceptable packages
- containedctx # containedctx is a linter that detects struct contained context.Context field
- cyclop # checks function and package cyclomatic complexity
- exhaustivestruct # Checks if all struct's fields are initialized
- funlen # Tool for detection of long functions
- gocyclo # Computes and checks the cyclomatic complexity of functions
- godot # Check if comments end in a period
- gomnd # An analyzer to detect magic numbers.
- ifshort # Checks that your code uses short syntax for if-statements whenever possible
- ireturn # Accept Interfaces, Return Concrete Types
- lll # Reports long lines
- maintidx # maintidx measures the maintainability index of each function.
- makezero # Finds slice declarations with non-zero initial length
- maligned # Tool to detect Go structs that would take less memory if their fields were sorted
- nakedret # Finds naked returns in functions greater than a specified function length
- nestif # Reports deeply nested if statements
- nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity
+1 -1
View File
@@ -267,7 +267,7 @@ func NewAgent(config *AgentConfig) (*Agent, error) { //nolint:gocognit
return nil, ErrLiteUsingNonHostCandidates
}
if config.Urls != nil && len(config.Urls) > 0 && !containsCandidateType(CandidateTypeServerReflexive, a.candidateTypes) && !containsCandidateType(CandidateTypeRelay, a.candidateTypes) {
if len(config.Urls) > 0 && !containsCandidateType(CandidateTypeServerReflexive, a.candidateTypes) && !containsCandidateType(CandidateTypeRelay, a.candidateTypes) {
a.closeMulticastConn()
return nil, ErrUselessUrlsProvided
}
+1 -1
View File
@@ -270,7 +270,7 @@ func (config *AgentConfig) initWithDefaults(a *Agent) {
a.checkInterval = *config.CheckInterval
}
if config.CandidateTypes == nil || len(config.CandidateTypes) == 0 {
if len(config.CandidateTypes) == 0 {
a.candidateTypes = defaultCandidateTypes()
} else {
a.candidateTypes = config.CandidateTypes
+3 -3
View File
@@ -66,13 +66,13 @@ func (p *CandidatePair) priority() uint64 {
// Just implement these here rather
// than fooling around with the math package
min := func(x, y uint32) uint64 {
localMin := func(x, y uint32) uint64 {
if x < y {
return uint64(x)
}
return uint64(y)
}
max := func(x, y uint32) uint64 {
localMax := func(x, y uint32) uint64 {
if x > y {
return uint64(x)
}
@@ -87,7 +87,7 @@ func (p *CandidatePair) priority() uint64 {
// 1<<32 overflows uint32; and if both g && d are
// maxUint32, this result would overflow uint64
return (1<<32-1)*min(g, d) + 2*max(g, d) + cmp(g, d)
return (1<<32-1)*localMin(g, d) + 2*localMax(g, d) + cmp(g, d)
}
func (p *CandidatePair) Write(b []byte) (int, error) {