Skip to content

Commit 3e1f46a

Browse files
authored
Remove funlen linter (#290)
1 parent f1c7226 commit 3e1f46a

20 files changed

+38
-38
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ linters:
5959
- exportloopref # checks for pointers to enclosing loop variables
6060
- forbidigo # Forbids identifiers
6161
- forcetypeassert # finds forced type assertions
62-
- funlen # Tool for detection of long functions
6362
- gci # Gci control golang package import order and make it always deterministic.
6463
- gochecknoglobals # Checks that no globals are present in Go code
6564
- gocognit # Computes and checks the cognitive complexity of functions
@@ -106,6 +105,7 @@ linters:
106105
- whitespace # Tool for detection of leading and trailing whitespace
107106
disable:
108107
- depguard # Go linter that checks if package imports are in a list of acceptable packages
108+
- funlen # Tool for detection of long functions
109109
- gochecknoinits # Checks that no init functions are present in Go code
110110
- 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.
111111
- interfacebloat # A linter that checks length of interface.

abscapturetimeextension_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"time"
99
)
1010

11-
func TestAbsCaptureTimeExtension_Roundtrip(t *testing.T) { // nolint: funlen,cyclop
11+
func TestAbsCaptureTimeExtension_Roundtrip(t *testing.T) { //nolint:cyclop
1212
t.Run("positive captureClockOffset", func(t *testing.T) {
1313
t0 := time.Now()
1414
e1 := NewAbsCaptureTimeExtension(t0)

codecs/av1_packet_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/pion/rtp/codecs/av1/obu"
1313
)
1414

15-
func TestAV1_Marshal(t *testing.T) { // nolint:funlen,cyclop
15+
func TestAV1_Marshal(t *testing.T) { //nolint:cyclop
1616
payloader := &AV1Payloader{}
1717

1818
t.Run("Unfragmented OBU", func(t *testing.T) {
@@ -103,7 +103,7 @@ func TestAV1_Unmarshal_Error(t *testing.T) {
103103
}
104104
}
105105

106-
func TestAV1_Unmarshal(t *testing.T) { // nolint: funlen
106+
func TestAV1_Unmarshal(t *testing.T) {
107107
// nolint: dupl
108108
av1Payload := []byte{
109109
0x68, 0x0c, 0x08, 0x00, 0x00, 0x00, 0x2c,

codecs/common_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func TestCommon_Min(t *testing.T) {
2424
}
2525
}
2626

27-
func TestZeroAllocations(t *testing.T) { // nolint: funlen, maintidx
27+
func TestZeroAllocations(t *testing.T) { //nolint:maintidx
2828
type unmarshaller interface {
2929
Unmarshal(data []byte) ([]byte, error)
3030
}

codecs/g711_packet_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"testing"
1111
)
1212

13-
func TestG711Payloader(t *testing.T) { // nolint:funlen
13+
func TestG711Payloader(t *testing.T) {
1414
payloader := G711Payloader{}
1515

1616
const (

codecs/g722_packet_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"testing"
1111
)
1212

13-
func TestG722Payloader(t *testing.T) { // nolint:funlen
13+
func TestG722Payloader(t *testing.T) {
1414
payloader := G722Payloader{}
1515

1616
const (

codecs/h264_packet.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func emitNalus(nals []byte, emit func([]byte)) {
6666
}
6767

6868
// Payload fragments a H264 packet across one or more byte arrays.
69-
func (p *H264Payloader) Payload(mtu uint16, payload []byte) [][]byte { // nolint:funlen,cyclop
69+
func (p *H264Payloader) Payload(mtu uint16, payload []byte) [][]byte { //nolint:cyclop
7070
var payloads [][]byte
7171
if len(payload) == 0 {
7272
return payloads
@@ -221,7 +221,7 @@ func (p *H264Packet) Unmarshal(payload []byte) ([]byte, error) {
221221
return p.parseBody(payload)
222222
}
223223

224-
func (p *H264Packet) parseBody(payload []byte) ([]byte, error) { // nolint:funlen,cyclop
224+
func (p *H264Packet) parseBody(payload []byte) ([]byte, error) { //nolint:cyclop
225225
if len(payload) == 0 {
226226
return nil, fmt.Errorf("%w: %d <=0", errShortPacket, len(payload))
227227
}

codecs/h264_packet_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"testing"
99
)
1010

11-
func TestH264Payloader_Payload(t *testing.T) { // nolint:funlen,cyclop
11+
func TestH264Payloader_Payload(t *testing.T) { //nolint:cyclop
1212
pck := H264Payloader{}
1313
smallpayload := []byte{0x90, 0x90, 0x90}
1414
multiplepayload := []byte{0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x01, 0x90}
@@ -94,7 +94,7 @@ func TestH264Payloader_Payload(t *testing.T) { // nolint:funlen,cyclop
9494
}
9595
}
9696

97-
func TestH264Packet_Unmarshal(t *testing.T) { // nolint:funlen,cyclop
97+
func TestH264Packet_Unmarshal(t *testing.T) { //nolint:cyclop
9898
singlePayload := []byte{0x90, 0x90, 0x90}
9999
singlePayloadUnmarshaled := []byte{0x00, 0x00, 0x00, 0x01, 0x90, 0x90, 0x90}
100100
singlePayloadUnmarshaledAVC := []byte{0x00, 0x00, 0x00, 0x03, 0x90, 0x90, 0x90}

codecs/h265_packet.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ func (p *H265AggregationPacket) WithDONL(value bool) {
300300
}
301301

302302
// Unmarshal parses the passed byte slice and stores the result in the H265AggregationPacket this method is called upon.
303-
func (p *H265AggregationPacket) Unmarshal(payload []byte) ([]byte, error) { // nolint: funlen, cyclop
303+
func (p *H265AggregationPacket) Unmarshal(payload []byte) ([]byte, error) { //nolint:cyclop
304304
// sizeof(headers)
305305
const totalHeaderSize = h265NaluHeaderSize
306306
if payload == nil {
@@ -860,7 +860,7 @@ type H265Payloader struct {
860860
}
861861

862862
// Payload fragments a H265 packet across one or more byte arrays.
863-
func (p *H265Payloader) Payload(mtu uint16, payload []byte) [][]byte { //nolint: gocognit,cyclop,funlen
863+
func (p *H265Payloader) Payload(mtu uint16, payload []byte) [][]byte { //nolint:gocognit,cyclop
864864
var payloads [][]byte
865865
if len(payload) == 0 || mtu == 0 {
866866
return payloads

codecs/h265_packet_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"testing"
99
)
1010

11-
func TestH265_NALU_Header(t *testing.T) { // nolint: funlen
11+
func TestH265_NALU_Header(t *testing.T) {
1212
tt := [...]struct {
1313
RawHeader []byte
1414

@@ -105,7 +105,7 @@ func TestH265_NALU_Header(t *testing.T) { // nolint: funlen
105105
}
106106
}
107107

108-
func TestH265_FU_Header(t *testing.T) { // nolint:funlen
108+
func TestH265_FU_Header(t *testing.T) {
109109
tt := [...]struct {
110110
header H265FragmentationUnitHeader
111111

@@ -172,7 +172,7 @@ func TestH265_FU_Header(t *testing.T) { // nolint:funlen
172172
}
173173
}
174174

175-
func TestH265_SingleNALUnitPacket(t *testing.T) { // nolint:funlen,cyclop
175+
func TestH265_SingleNALUnitPacket(t *testing.T) { //nolint:cyclop
176176
tt := [...]struct {
177177
Raw []byte
178178
WithDONL bool
@@ -269,7 +269,7 @@ func TestH265_SingleNALUnitPacket(t *testing.T) { // nolint:funlen,cyclop
269269
}
270270
}
271271

272-
func TestH265_AggregationPacket(t *testing.T) { // nolint:funlen,cyclop
272+
func TestH265_AggregationPacket(t *testing.T) { //nolint:cyclop
273273
tt := [...]struct {
274274
Raw []byte
275275
WithDONL bool
@@ -436,7 +436,7 @@ func TestH265_AggregationPacket(t *testing.T) { // nolint:funlen,cyclop
436436
}
437437
}
438438

439-
func TestH265_FragmentationUnitPacket(t *testing.T) { // nolint:funlen,cyclop
439+
func TestH265_FragmentationUnitPacket(t *testing.T) { //nolint:cyclop
440440
tt := [...]struct {
441441
Raw []byte
442442
WithDONL bool
@@ -595,7 +595,7 @@ func TestH265_TemporalScalabilityControlInformation(t *testing.T) {
595595
}
596596
}
597597

598-
func TestH265_PACI_Packet(t *testing.T) { // nolint:funlen, cyclop
598+
func TestH265_PACI_Packet(t *testing.T) { //nolint:cyclop
599599
tt := [...]struct {
600600
Raw []byte
601601
ExpectedFU *H265PACIPacket
@@ -723,7 +723,7 @@ func TestH265_PACI_Packet(t *testing.T) { // nolint:funlen, cyclop
723723
}
724724
}
725725

726-
func TestH265_Packet(t *testing.T) { // nolint: funlen
726+
func TestH265_Packet(t *testing.T) {
727727
tt := [...]struct {
728728
Raw []byte
729729
WithDONL bool
@@ -873,7 +873,7 @@ func TestH265_Packet_Real(t *testing.T) {
873873
}
874874
}
875875

876-
func TestH265Payloader_Payload(t *testing.T) { // nolint: funlen
876+
func TestH265Payloader_Payload(t *testing.T) {
877877
tt := []struct {
878878
Name string
879879
Data []byte

0 commit comments

Comments
 (0)